fluxcd: fix update script
This commit is contained in:
parent
e12483116b
commit
e3ea6e8b2c
1 changed files with 6 additions and 5 deletions
|
@ -21,16 +21,17 @@ if [ ! "$OLD_VERSION" = "$LATEST_VERSION" ]; then
|
||||||
setKV version ${LATEST_VERSION}
|
setKV version ${LATEST_VERSION}
|
||||||
setKV sha256 ${SHA256}
|
setKV sha256 ${SHA256}
|
||||||
setKV manifestsSha256 ${SPEC_SHA256}
|
setKV manifestsSha256 ${SPEC_SHA256}
|
||||||
setKV vendorSha256 "0000000000000000000000000000000000000000000000000000" # The same as lib.fakeSha256
|
setKV vendorHash "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" # The same as lib.fakeHash
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
VENDOR_SHA256=$(nix-build --no-out-link -A fluxcd $NIXPKGS_PATH 2>&1 >/dev/null | grep "got:" | cut -d':' -f2 | sed 's| ||g')
|
VENDOR_HASH=$(nix-build --no-out-link -A fluxcd $NIXPKGS_PATH 2>&1 >/dev/null | grep "got:" | cut -d':' -f2 | sed 's| ||g')
|
||||||
|
VENDOR_HASH=$(nix hash to-sri --type sha256 $VENDOR_HASH)
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ -n "${VENDOR_SHA256:-}" ]; then
|
if [ -n "${VENDOR_HASH:-}" ]; then
|
||||||
setKV vendorSha256 ${VENDOR_SHA256}
|
setKV vendorHash ${VENDOR_HASH}
|
||||||
else
|
else
|
||||||
echo "Update failed. VENDOR_SHA256 is empty."
|
echo "Update failed. VENDOR_HASH is empty."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue