build: remove {sha256,md5} output for push-storage-object effects

This commit is contained in:
Brendan Hay 2020-11-05 13:19:09 +01:00 committed by Joe Bryan
parent e9cf0a3518
commit 767a6f85a4
3 changed files with 11 additions and 40 deletions

32
ci.nix
View File

@ -21,34 +21,18 @@ let
localLib = callPackage ./nix/lib { };
# The key with google storage bucket write permission,
# deployed to ci via nixops `deployment.keys."service-account.json"`.
# deployed to ci via nixops deployment.keys."service-account.json".
serviceAccountKey = builtins.readFile
("/var/lib/hercules-ci-agent/secrets/service-account.json");
# Push a derivation to a remote storage bucket as a post-build effect.
pushObject = { name, drv, contentType ? "application/octet-stream" }:
localLib.pushStorageObject {
inherit name contentType serviceAccountKey;
bucket = "bootstrap.urbit.org";
object = "ci/${lib.removePrefix "/nix/store/" (toString drv)}";
file = drv.out;
};
# # Build and push a split output pill derivation with the ".pill" file extension.
# pushPill = name: pill:
# pushObject {
# inherit name;
# drv = pill.build;
# extension = "pill";
# };
# Filter out systems that this machine does not support.
systems = lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
linux = "x86_64-linux";
darwin = "x86_64-darwin";
};
# Build the ci matrix for each of the supported systems, see finalPackages
# for the total set of attributes that will be evaluated per system.
in localLib.dimension "system" systems (systemName: system:
let
dynamicPackages = import ./default.nix {
@ -90,9 +74,13 @@ in localLib.dimension "system" systems (systemName: system:
# Push the tarball to the google storage bucket for the current platform.
release = let inherit (staticPackages) tarball;
in pushObject {
in localLib.pushStorageObject {
inherit serviceAccountKey;
bucket = "bootstrap.urbit.org";
object = "ci/${lib.removePrefix "/nix/store/" (toString tarball)}";
name = tarball.name;
drv = tarball;
file = tarball.out;
contentType = "application/x-gtar";
};
};

View File

@ -13,10 +13,9 @@ let
in stdenvNoCC.mkDerivation {
name = "${name}.${extension}";
phases = [ "buildPhase" ];
outputs = [ "out" "hash" ];
nativeBuildInputs = [ coreutils ];
phases = [ "buildPhase" "hashPhase" ];
buildPhase = ''
tar -vczf $out \
@ -27,14 +26,5 @@ in stdenvNoCC.mkDerivation {
${sources}
'';
hashPhase = ''
mkdir $hash
md5sum $out | awk '{printf $1}' > $hash/md5
sha256sum $out | awk '{printf $1}' > $hash/sha256
'';
preferLocalBuild = true;
meta = { inherit extension; };
}

View File

@ -3,20 +3,13 @@
stdenvNoCC.mkDerivation {
name = "${name}.pill";
src = pier;
outputs = [ "out" "hash" ];
buildInputs = [ urbit herb ];
dontUnpack = true;
buildPhase = builtins.readFile builder;
installPhase = ''
mv ${name}.pill $out
mkdir $hash
md5sum $out | awk '{printf $1}' > $hash/md5
sha256sum $out | awk '{printf $1}' > $hash/sha256
'';
ARVO = arvo;