Remove release script
This commit is contained in:
parent
b987cba515
commit
7077c1154a
3 changed files with 0 additions and 45 deletions
|
@ -21,6 +21,5 @@
|
|||
./blog-pim.nix
|
||||
./forgejo-nix-action.nix
|
||||
./atticd.nix
|
||||
./release.nix
|
||||
];
|
||||
}
|
||||
|
|
19
release.nix
19
release.nix
|
@ -1,19 +0,0 @@
|
|||
{ nixpkgs, flutils, ... }: flutils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
createScript = name: runtimeInputs: scriptPath:
|
||||
let
|
||||
script = (pkgs.writeScriptBin name (builtins.readFile scriptPath)).overrideAttrs (old: {
|
||||
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||
});
|
||||
in
|
||||
pkgs.symlinkJoin {
|
||||
inherit name;
|
||||
paths = [ script ] ++ runtimeInputs;
|
||||
buildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = "wrapProgram $out/bin/${name} --set PATH $out/bin";
|
||||
};
|
||||
in
|
||||
{
|
||||
packages.release = createScript "release" (with pkgs; [ nix docker-client git ]) ./release.sh;
|
||||
})
|
25
release.sh
25
release.sh
|
@ -1,25 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
flakeref="${1-}"
|
||||
name="${2-}"
|
||||
gitdir="${3:-.}"
|
||||
|
||||
if [ -z "$flakeref" ] || [ -z "$name" ];
|
||||
then
|
||||
echo "Usage: $0 FLAKEREF NAME [GITDIR]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
imagename=$(nix eval --no-allow-dirty --raw $flakeref.imageName)
|
||||
imagetag=$(nix eval --no-allow-dirty --raw $flakeref.imageTag)
|
||||
image=$(nix build --no-allow-dirty $flakeref --print-out-paths --no-link)
|
||||
gitrev=$(git --git-dir $gitdir/.git --work-tree $gitdir rev-parse HEAD)
|
||||
|
||||
docker load < $image
|
||||
docker tag $imagename:$imagetag git.kun.is/home/$name:$gitrev
|
||||
docker tag $imagename:$imagetag git.kun.is/home/$name:latest
|
||||
docker push git.kun.is/home/$name:$gitrev
|
||||
docker push git.kun.is/home/$name:latest
|
Reference in a new issue