Remove release script

This commit is contained in:
Pim Kunis 2024-04-30 13:14:20 +02:00
parent b987cba515
commit 7077c1154a
3 changed files with 0 additions and 45 deletions

View file

@ -21,6 +21,5 @@
./blog-pim.nix
./forgejo-nix-action.nix
./atticd.nix
./release.nix
];
}

View file

@ -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;
})

View file

@ -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