mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 20:39:04 +02:00
pomerium: add update script
This commit is contained in:
parent
19f6505f86
commit
d76601d559
|
@ -111,10 +111,13 @@ buildGoModule rec {
|
||||||
install -Dm0755 $GOPATH/bin/pomerium $out/bin/pomerium
|
install -Dm0755 $GOPATH/bin/pomerium $out/bin/pomerium
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests = {
|
passthru = {
|
||||||
|
tests = {
|
||||||
inherit (nixosTests) pomerium;
|
inherit (nixosTests) pomerium;
|
||||||
inherit pomerium-cli;
|
inherit pomerium-cli;
|
||||||
};
|
};
|
||||||
|
updateScript = ./updater.sh;
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://pomerium.io";
|
homepage = "https://pomerium.io";
|
||||||
|
|
23
pkgs/servers/http/pomerium/updater.sh
Executable file
23
pkgs/servers/http/pomerium/updater.sh
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#! /usr/bin/env nix-shell
|
||||||
|
#! nix-shell -i bash -p gnugrep coreutils curl wget jq nix-update prefetch-yarn-deps
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
pushd "$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
owner="pomerium"
|
||||||
|
repo="pomerium"
|
||||||
|
version=`curl -s "https://api.github.com/repos/$owner/$repo/tags" | jq -r .[0].name | grep -oP "^v\K.*"`
|
||||||
|
url="https://raw.githubusercontent.com/$owner/$repo/v$version/"
|
||||||
|
|
||||||
|
if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
|
||||||
|
echo "Already up to date!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f package.json yarn.lock
|
||||||
|
wget "$url/ui/yarn.lock" "$url/ui/package.json"
|
||||||
|
echo $(prefetch-yarn-deps) > yarn-hash
|
||||||
|
rm -f yarn.lock
|
||||||
|
|
||||||
|
popd
|
||||||
|
nix-update pomerium --version $version
|
Loading…
Reference in a new issue