mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 13:00:23 +00:00
reposilite: add updateScript
this script also updates the plugin hashes
(cherry picked from commit e69c6d0fdc)
This commit is contained in:
@@ -41,6 +41,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
meta = {
|
||||
description = "Lightweight and easy-to-use repository management software dedicated for the Maven based artifacts in the JVM ecosystem";
|
||||
homepage = "https://github.com/dzikoysk/reposilite";
|
||||
|
||||
7
pkgs/by-name/re/reposilite/plugins.json
Normal file
7
pkgs/by-name/re/reposilite/plugins.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"checksum": "sha256-s7GADQqFsoEDM2vtJFE/C/F5jGyQeYlT3BntvHS4DtQ=",
|
||||
"groovy": "sha256-8HWMqZZNIqCBpkMuCjKxqTLcQ2dYaOAAYON9QrXYEyo=",
|
||||
"migration": "sha256-Xv0+RsXZzyGV/4v0IT3hfNANiC1OWVYFoTZHDxduKh0=",
|
||||
"prometheus": "sha256-F5fSUo6wt7L3R/xCike0SlfG3CyxHKrlrg+SNrUYtm4=",
|
||||
"swagger": "sha256-wyXKrYBhigHVtxq/RZiJhnigc3Z/UCbYotrF6VLLTGA="
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
{
|
||||
lib,
|
||||
generateSplicesForMkScope,
|
||||
makeScopeWithSplicing',
|
||||
}:
|
||||
let
|
||||
pluginHashes = lib.importJSON ./plugins.json;
|
||||
in
|
||||
makeScopeWithSplicing' {
|
||||
otherSplices = generateSplicesForMkScope "reposilitePlugins";
|
||||
f =
|
||||
@@ -39,11 +43,5 @@ makeScopeWithSplicing' {
|
||||
)
|
||||
) { };
|
||||
}
|
||||
// builtins.mapAttrs (name: hash: self.fetchPlugin { inherit name hash; }) {
|
||||
checksum = "sha256-s7GADQqFsoEDM2vtJFE/C/F5jGyQeYlT3BntvHS4DtQ=";
|
||||
groovy = "sha256-8HWMqZZNIqCBpkMuCjKxqTLcQ2dYaOAAYON9QrXYEyo=";
|
||||
migration = "sha256-Xv0+RsXZzyGV/4v0IT3hfNANiC1OWVYFoTZHDxduKh0=";
|
||||
prometheus = "sha256-F5fSUo6wt7L3R/xCike0SlfG3CyxHKrlrg+SNrUYtm4=";
|
||||
swagger = "sha256-wyXKrYBhigHVtxq/RZiJhnigc3Z/UCbYotrF6VLLTGA=";
|
||||
};
|
||||
// builtins.mapAttrs (name: hash: self.fetchPlugin { inherit name hash; }) pluginHashes;
|
||||
}
|
||||
|
||||
20
pkgs/by-name/re/reposilite/update.sh
Executable file
20
pkgs/by-name/re/reposilite/update.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
|
||||
# shellcheck shell=bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
latestVersion=$(list-git-tags --url=https://github.com/dzikoysk/reposilite | grep -E '^[0-9.]+$' | sort --reverse --version-sort | head -n 1)
|
||||
|
||||
update-source-version reposilite "$latestVersion"
|
||||
|
||||
jq -r 'keys[]' ./pkgs/by-name/re/reposilite/plugins.json | while read -r plugin; do
|
||||
tmpfile=$(mktemp)
|
||||
curl -o "$tmpfile" "https://maven.reposilite.com/releases/com/reposilite/plugin/$plugin-plugin/$latestVersion/$plugin-plugin-$latestVersion-all.jar"
|
||||
hash=$(nix-hash --sri --flat --type sha256 "$tmpfile")
|
||||
|
||||
updatedContent=$(jq ".$plugin = \"$hash\"" ./pkgs/by-name/re/reposilite/plugins.json)
|
||||
echo -E "$updatedContent" > ./pkgs/by-name/re/reposilite/plugins.json
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user