From 17ae0dbdd5d1bf5c473944aa8111ab7763917fba Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Thu, 27 Feb 2025 11:37:40 -0600 Subject: [PATCH] Build in parallel, add sword builder --- .gitlab-ci.yml | 16 +++++++++------- flake.nix | 16 ++++++++++++++++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e3af95..7a4cae0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,15 +3,17 @@ stages: build: stage: build + parallel: + matrix: + - IMG: + - vm-test + - sword-container-builder tags: - nix - podman script: - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - |- - for img in vm-test; do - nix build ".#${img}" - podman load -i result - podman tag "localhost/${img}:latest" $CI_REGISTRY/greg/ci-images/${img}:latest - podman push "$CI_REGISTRY/greg/ci-images/${img}:latest" - done + - nix build ".#${IMG}" + - podman load -i result + - podman tag "localhost/${IMG}:latest" $CI_REGISTRY/greg/ci-images/${IMG}:latest + - podman push "$CI_REGISTRY/greg/ci-images/${IMG}:latest" diff --git a/flake.nix b/flake.nix index ddfac9a..41cb87d 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,22 @@ config.allowUnfree = true; }; packages = { + sword-container-builder = pkgs.dockerTools.buildLayeredImage { + name = "sword-container-builder"; + tag = "latest"; + contents = with pkgs; [ + podman + dockerTools.binSh + dockerTools.caCertificates + coreutils + gnugrep + sword + dockerTools.usrBinEnv + ]; + config.Env = [ + "CURL_CA_BUNDLE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" + ]; + }; vm-test = let basicPython = (pkgs.python3.withPackages (p: with p; [ pyyaml ])); in pkgs.dockerTools.buildLayeredImage {