rundeck: add update script (#401735)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
which,
|
||||
coreutils,
|
||||
openssh,
|
||||
writeScript,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
@@ -43,6 +44,22 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update-rundeck" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p common-updater-scripts curl jq
|
||||
set -eu -o pipefail
|
||||
|
||||
latest_tag=$(curl -s "https://api.github.com/repos/rundeck/rundeck/tags" | jq -r '.[0].name')
|
||||
version=$(echo "$latest_tag" | sed -E 's/^v//')
|
||||
full_version="$version-$(date +"%Y%m%d")"
|
||||
|
||||
if [[ "x$UPDATE_NIX_OLD_VERSION" != "x$full_version" ]]; then
|
||||
download_url="https://packagecloud.io/pagerduty/rundeck/packages/java/org.rundeck/rundeck-$full_version.war/artifacts/rundeck-$full_version.war/download?distro_version_id=167"
|
||||
hash=$(curl -L "$download_url" | nix-hash --flat --type sha256 --base32 - | nix hash to-sri --type sha256)
|
||||
update-source-version "$UPDATE_NIX_ATTR_PATH" "$full_version" "$hash"
|
||||
fi
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Job scheduler and runbook automation";
|
||||
longDescription = ''
|
||||
|
||||
Reference in New Issue
Block a user