Skip to content

Commit

Permalink
sonarr: create update script
Browse files Browse the repository at this point in the history
  • Loading branch information
andreisergiu98 committed Mar 24, 2021
1 parent 65e68dc commit bdbb07a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkgs/servers/sonarr/default.nix
Expand Up @@ -20,8 +20,9 @@ stdenv.mkDerivation rec {
curl sqlite libmediainfo ]}
'';

passthru.tests = {
smoke-test = nixosTests.sonarr;
passthru = {
updateScript = "./update.sh";
tests.smoke-test = nixosTests.sonarr;
};

meta = {
Expand Down
7 changes: 7 additions & 0 deletions pkgs/servers/sonarr/update.sh
@@ -0,0 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts

latestTag=$(curl https://api.github.com/repos/Sonarr/Sonarr/tags | jq -r '.[] | .name' | sort --version-sort | tail -1)
version="$(expr $latestTag : 'v\(.*\)')"

update-source-version sonarr "$version"

0 comments on commit bdbb07a

Please sign in to comment.