gotify: adapt update script to use vendor sha

This commit is contained in:
Doron Behar 2020-05-15 01:39:42 +03:00
parent 39b92f6e45
commit 5746259af6
3 changed files with 8 additions and 7 deletions

View file

@ -21,7 +21,7 @@ buildGoModule rec {
sha256 = import ./source-sha.nix; sha256 = import ./source-sha.nix;
}; };
vendorSha256 = "1ha0zgz1n07sd3if6823fi83j7yajysjdzfbwqk9rpsi6zv3cfh3"; vendorSha256 = import ./vendor-sha.nix;
postPatch = '' postPatch = ''
substituteInPlace app.go \ substituteInPlace app.go \

View file

@ -11,9 +11,9 @@ echo got version $version
echo \""${version#v}"\" > "$dirname/version.nix" echo \""${version#v}"\" > "$dirname/version.nix"
printf '%s' $(nix-prefetch-git --quiet --rev ${version} https://github.com/gotify/server | jq .sha256) > $dirname/source-sha.nix printf '%s' $(nix-prefetch-git --quiet --rev ${version} https://github.com/gotify/server | jq .sha256) > $dirname/source-sha.nix
tput setaf 1 tput setaf 1
echo zeroing modSha256 in $dirname/mod-sha.nix echo zeroing vendorSha256 in $dirname/vendor-sha.nix
tput sgr0 tput sgr0
printf '"%s"' "0000000000000000000000000000000000000000000000000000" > $dirname/mod-sha.nix printf '"%s"' "0000000000000000000000000000000000000000000000000000" > $dirname/vendor-sha.nix
GOTIFY_WEB_SRC="https://raw.githubusercontent.com/gotify/server/$version" GOTIFY_WEB_SRC="https://raw.githubusercontent.com/gotify/server/$version"
@ -28,13 +28,13 @@ echo removed yarn.lock
echo running nix-build for ui echo running nix-build for ui
nix-build -A gotify-server.ui nix-build -A gotify-server.ui
echo running nix-build for gotify itself in order to get modSha256 echo running nix-build for gotify itself in order to get vendorSha256
set +e set +e
modSha256="$(nix-build -A gotify-server 2>&1 | grep "got:" | cut -d':' -f3)" vendorSha256="$(nix-build -A gotify-server 2>&1 | grep "got:" | cut -d':' -f3)"
set -e set -e
printf '"%s"' "$modSha256" > $dirname/mod-sha.nix printf '"%s"' "$vendorSha256" > $dirname/vendor-sha.nix
tput setaf 2 tput setaf 2
echo got modSha256 of: $modSha256 echo got vendorSha256 of: $vendorSha256
tput sgr0 tput sgr0
echo running nix-build -A gotify-server which should build gotify-server normally echo running nix-build -A gotify-server which should build gotify-server normally
nix-build -A gotify-server nix-build -A gotify-server

View file

@ -0,0 +1 @@
"1ha0zgz1n07sd3if6823fi83j7yajysjdzfbwqk9rpsi6zv3cfh3"