Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

wiki-js: add update script

+17 -1
+4 -1
pkgs/servers/web-apps/wiki-js/default.nix
··· 21 21 runHook postInstall 22 22 ''; 23 23 24 - passthru.tests = { inherit (nixosTests) wiki-js; }; 24 + passthru = { 25 + tests = { inherit (nixosTests) wiki-js; }; 26 + updateScript = ./update.sh; 27 + }; 25 28 26 29 meta = with lib; { 27 30 homepage = "https://js.wiki/";
+13
pkgs/servers/web-apps/wiki-js/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p curl common-updater-scripts 3 + 4 + oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion wiki-js" | tr -d '"')" 5 + latestTag="$(git ls-remote --tags --sort="v:refname" https://github.com/Requarks/wiki.git | tail -1 | awk '{ print $2 }' | sed -E "s,^refs/tags/v(.*)$,\1,")" 6 + 7 + targetVersion="${1:-$latestTag}" 8 + if [ ! "${oldVersion}" = "${targetVersion}" ]; then 9 + update-source-version wiki-js "${targetVersion}" 10 + nix-build -A wiki-js 11 + else 12 + echo "wiki-js is already up-to-date" 13 + fi