From 244142274daf54cc61b58822b5187da1d07c762e Mon Sep 17 00:00:00 2001 From: technofab Date: Fri, 21 Feb 2025 18:52:55 +0100 Subject: [PATCH] fix(ci): build correct package and hopefully handle cache issues --- templates/nix-gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/nix-gitlab-ci.yml b/templates/nix-gitlab-ci.yml index 6d45a96..a3c83e8 100644 --- a/templates/nix-gitlab-ci.yml +++ b/templates/nix-gitlab-ci.yml @@ -53,15 +53,15 @@ nix-ci:build: paths: - .nix-cache/ before_script: - # generated-gitlab-ci.yml exists in the cache - - '[ -f "generated-gitlab-ci.yml" ] && export CACHED=true && echo "A cached pipeline file exists (skip cache with NIX_CI_FORCE_BUILD)" || true' + # generated-gitlab-ci-.yml exists in the cache + - '[ -f "generated-gitlab-ci-${_NIX_CI_PIPELINE_NAME}.yml" ] && export CACHED=true && echo "A cached pipeline file exists (skip cache with NIX_CI_FORCE_BUILD)" || true' # allow the user to manually skip the cache (when the key files are not correctly configured etc.) - '[ -n "$_NIX_CI_FORCE_BUILD" ] && unset CACHED && echo "Caching skipped for this job (through NIX_CI_FORCE_BUILD)" || true' # only setup when we need to generate the pipeline yaml - 'if [ -z "$CACHED" ]; then source setup_nix_ci; fi' script: # build the generated-gitlab-ci.yml if it does not exist in the cache - - 'if [ -z "$CACHED" ]; then nix build .#gitlab-ci-config && install result generated-gitlab-ci.yml; fi' + - 'if [ -z "$CACHED" ]; then nix build .#gitlab-ci:pipeline:${_NIX_CI_PIPELINE_NAME} && install result generated-gitlab-ci-${_NIX_CI_PIPELINE_NAME}.yml; fi' after_script: # NOTE: environment variables of before_script and script don't exist here anymore #