Skip to content

Commit

Permalink
linkerd: update script fix #3
Browse files Browse the repository at this point in the history
  • Loading branch information
superherointj committed Oct 14, 2021
1 parent f8d8987 commit 0b32a42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pkgs/applications/networking/cluster/linkerd/update-edge.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnugrep gnused jq

set -eu -o pipefail
set -x -eu -o pipefail

cd $(dirname "$0")

Expand All @@ -14,7 +14,7 @@ VERSION=$(echo ${TAG} | sed 's/^edge-//')
SHA256=$(nix-prefetch-url --quiet --unpack https://github.com/linkerd/linkerd2/archive/refs/tags/${TAG}.tar.gz)

setKV () {
sed -i "s|$1 = \".*\"|$1 = \"$2\"|" ./edge.nix
sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" ./edge.nix
}

setKV version ${VERSION}
Expand All @@ -25,9 +25,9 @@ cd ../../../../../
set +e
VENDOR_SHA256=$(nix-build --no-out-link -A linkerd_edge 2>&1 | grep "got:" | cut -d':' -f2 | sed 's| ||g')
set -e
cd - > /dev/null

if [ -n "${VENDOR_SHA256:-}" ]; then
cd - > /dev/null
setKV vendorSha256 ${VENDOR_SHA256}
else
echo "Update failed. VENDOR_SHA256 is empty."
Expand Down
12 changes: 6 additions & 6 deletions pkgs/applications/networking/cluster/linkerd/update-stable.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnugrep gnused jq

set -eu -o pipefail
set -x -eu -o pipefail

cd $(dirname "$0")

Expand All @@ -14,7 +14,7 @@ VERSION=$(echo ${TAG} | sed 's/^stable-//')
SHA256=$(nix-prefetch-url --quiet --unpack https://github.com/linkerd/linkerd2/archive/refs/tags/${TAG}.tar.gz)

setKV () {
sed -i "s|$1 = \".*\"|$1 = \"$2\"|" ./default.nix
sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" ./default.nix
}

setKV version ${VERSION}
Expand All @@ -25,11 +25,11 @@ cd ../../../../../
set +e
VENDOR_SHA256=$(nix-build --no-out-link -A linkerd 2>&1 | grep "got:" | cut -d':' -f2 | sed 's| ||g')
set -e
cd - > /dev/null

if [ -n "${VENDOR_SHA256:-}" ]; then
cd - > /dev/null
setKV vendorSha256 ${VENDOR_SHA256}
setKV vendorSha256 ${VENDOR_SHA256}
else
echo "Update failed. VENDOR_SHA256 is empty."
exit 1
echo "Update failed. VENDOR_SHA256 is empty."
exit 1
fi

0 comments on commit 0b32a42

Please sign in to comment.