linkerd: fix updateScript 5th attempt
This commit is contained in:
parent
18b39d6b57
commit
f0ef52fc1f
2 changed files with 11 additions and 15 deletions
|
@ -5,13 +5,11 @@ set -x -eu -o pipefail
|
||||||
|
|
||||||
cd $(dirname "$0")
|
cd $(dirname "$0")
|
||||||
|
|
||||||
TAG=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} \
|
VERSION=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} \
|
||||||
--silent https://api.github.com/repos/linkerd/linkerd2/releases | \
|
--silent https://api.github.com/repos/linkerd/linkerd2/releases | \
|
||||||
jq 'map(.tag_name)' | grep edge | sed 's/["|,| ]//g' | sort -r | head -n1)
|
jq 'map(.tag_name)' | grep edge | sed 's/["|,| ]//g' | sed 's/edge-//' | sort -V -r | head -n1)
|
||||||
|
|
||||||
VERSION=$(echo ${TAG} | sed 's/^edge-//')
|
SHA256=$(nix-prefetch-url --quiet --unpack https://github.com/linkerd/linkerd2/archive/refs/tags/edge-${VERSION}.tar.gz)
|
||||||
|
|
||||||
SHA256=$(nix-prefetch-url --quiet --unpack https://github.com/linkerd/linkerd2/archive/refs/tags/${TAG}.tar.gz)
|
|
||||||
|
|
||||||
setKV () {
|
setKV () {
|
||||||
sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" ./edge.nix
|
sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" ./edge.nix
|
||||||
|
@ -19,11 +17,11 @@ setKV () {
|
||||||
|
|
||||||
setKV version ${VERSION}
|
setKV version ${VERSION}
|
||||||
setKV sha256 ${SHA256}
|
setKV sha256 ${SHA256}
|
||||||
setKV vendorSha256 "" # Necessary to force clean build.
|
setKV vendorSha256 "0000000000000000000000000000000000000000000000000000" # Necessary to force clean build.
|
||||||
|
|
||||||
cd ../../../../../
|
cd ../../../../../
|
||||||
set +e
|
set +e
|
||||||
VENDOR_SHA256=$(nix-build --no-out-link -A linkerd_edge 2>&1 | grep "got:" | cut -d':' -f2 | sed 's| ||g')
|
VENDOR_SHA256=$(nix-build --no-out-link -A linkerd_edge 2>&1 >/dev/null | grep "got:" | cut -d':' -f2 | sed 's| ||g')
|
||||||
set -e
|
set -e
|
||||||
cd - > /dev/null
|
cd - > /dev/null
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,11 @@ set -x -eu -o pipefail
|
||||||
|
|
||||||
cd $(dirname "$0")
|
cd $(dirname "$0")
|
||||||
|
|
||||||
TAG=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} \
|
VERSION=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} \
|
||||||
--silent https://api.github.com/repos/linkerd/linkerd2/releases/latest | \
|
--silent https://api.github.com/repos/linkerd/linkerd2/releases | \
|
||||||
jq -r '.tag_name')
|
jq 'map(.tag_name)' | grep stable | sed 's/["|,| ]//g' | sed 's/stable-//' | sort -V -r | head -n1)
|
||||||
|
|
||||||
VERSION=$(echo ${TAG} | sed 's/^stable-//')
|
SHA256=$(nix-prefetch-url --quiet --unpack https://github.com/linkerd/linkerd2/archive/refs/tags/stable-${VERSION}.tar.gz)
|
||||||
|
|
||||||
SHA256=$(nix-prefetch-url --quiet --unpack https://github.com/linkerd/linkerd2/archive/refs/tags/${TAG}.tar.gz)
|
|
||||||
|
|
||||||
setKV () {
|
setKV () {
|
||||||
sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" ./default.nix
|
sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" ./default.nix
|
||||||
|
@ -19,11 +17,11 @@ setKV () {
|
||||||
|
|
||||||
setKV version ${VERSION}
|
setKV version ${VERSION}
|
||||||
setKV sha256 ${SHA256}
|
setKV sha256 ${SHA256}
|
||||||
setKV vendorSha256 "" # Necessary to force clean build.
|
setKV vendorSha256 "0000000000000000000000000000000000000000000000000000" # Necessary to force clean build.
|
||||||
|
|
||||||
cd ../../../../../
|
cd ../../../../../
|
||||||
set +e
|
set +e
|
||||||
VENDOR_SHA256=$(nix-build --no-out-link -A linkerd 2>&1 | grep "got:" | cut -d':' -f2 | sed 's| ||g')
|
VENDOR_SHA256=$(nix-build --no-out-link -A linkerd 2>&1 >/dev/null | grep "got:" | cut -d':' -f2 | sed 's| ||g')
|
||||||
set -e
|
set -e
|
||||||
cd - > /dev/null
|
cd - > /dev/null
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue