mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 01:13:05 +00:00
wiki-js: add update script
This commit is contained in:
parent
503c8093be
commit
2e2aed7100
@ -21,7 +21,10 @@ stdenv.mkDerivation rec {
|
|||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests = { inherit (nixosTests) wiki-js; };
|
passthru = {
|
||||||
|
tests = { inherit (nixosTests) wiki-js; };
|
||||||
|
updateScript = ./update.sh;
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://js.wiki/";
|
homepage = "https://js.wiki/";
|
||||||
|
13
pkgs/servers/web-apps/wiki-js/update.sh
Executable file
13
pkgs/servers/web-apps/wiki-js/update.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p curl common-updater-scripts
|
||||||
|
|
||||||
|
oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion wiki-js" | tr -d '"')"
|
||||||
|
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,")"
|
||||||
|
|
||||||
|
targetVersion="${1:-$latestTag}"
|
||||||
|
if [ ! "${oldVersion}" = "${targetVersion}" ]; then
|
||||||
|
update-source-version wiki-js "${targetVersion}"
|
||||||
|
nix-build -A wiki-js
|
||||||
|
else
|
||||||
|
echo "wiki-js is already up-to-date"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user