From 5441a6284a941f1520a63e77ec1a5651757805da Mon Sep 17 00:00:00 2001 From: technofab Date: Wed, 24 Apr 2024 21:41:43 +0200 Subject: [PATCH] ci: also build tf.json and tar file for each template --- flake.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index b450da0..11df176 100644 --- a/flake.nix +++ b/flake.nix @@ -87,6 +87,19 @@ stages = ["build" "upload"]; jobs = { "build" = { + stage = "build"; + parallel.matrix = [ + {TEMPLATE = ["nix-kubernetes"];} + ]; + deps = [pkgs.gnutar]; + script = [ + "nix build .#\${TEMPLATE}" + "install result templates/\${TEMPLATE}.tf.json" + "tar -cf templates/\${TEMPLATE}.tar -C templates \${TEMPLATE}.tf.json" + ]; + artifacts.paths = ["templates/"]; + }; + "build:image" = { stage = "build"; script = [ "nix build .#nix-coder-image" @@ -98,8 +111,8 @@ }; "upload" = { stage = "upload"; - needs = ["build"]; deps = [pkgs.skopeo]; + needs = ["build:image"]; script = [ '' skopeo --insecure-policy copy --dest-creds "''${CI_REGISTRY_USER}:''${CI_REGISTRY_PASSWORD}" --tmpdir /tmp \