From 62e465c09488fbe0b845b769f986e37d1b8342da Mon Sep 17 00:00:00 2001 From: technofab Date: Fri, 7 Mar 2025 17:32:49 +0100 Subject: [PATCH] fix(template): overriding default variables in child pipeline --- templates/nix-gitlab-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/nix-gitlab-ci.yml b/templates/nix-gitlab-ci.yml index 6ac8a82..b00ac79 100644 --- a/templates/nix-gitlab-ci.yml +++ b/templates/nix-gitlab-ci.yml @@ -49,6 +49,13 @@ nix-ci:build: || NIX_CI_PIPELINE_NAME="$CI_PIPELINE_SOURCE"; fi echo "NIX_CI_GENERATED_PIPELINE_NAME=$NIX_CI_PIPELINE_NAME" >> trigger.env + # inheritance of pipeline variables is a bit weird, so explicitly override them + # (ctx: setting any of these in the project variables would only apply correctly + # in this pipeline, not the child pipeline, instead weirdly enough the default + # variables above are used). If any other variables are added at the top, add them + # here aswell + echo "NIX_CI_IMAGE=$NIX_CI_IMAGE" >> trigger.env + echo "NIX_CI_CACHE_STRATEGY=$NIX_CI_CACHE_STRATEGY" >> trigger.env mkdir -p .nix-ci-pipelines/ # generated-gitlab-ci.yml exists in the cache