chore(template): skip checking if pipeline exists, just fail if not

This commit is contained in:
technofab 2025-02-28 11:54:41 +01:00
parent 36c4fc0fd6
commit 7a40a68a10

View file

@ -72,8 +72,7 @@ nix-ci:build:
- '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 eval --json ".#gitlab-ci:pipeline:${_NIX_CI_PIPELINE_NAME}" &>/dev/null && _NAME=$_NIX_CI_PIPELINE_NAME || _NAME="default"; fi'
- 'if [ -z "$CACHED" ]; then nix build .#gitlab-ci:pipeline:${_NAME} && 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.yml; fi'
after_script:
# save to binary cache or Gitlab CI cache only if we actually built something
# check if /tmp/nix-store-before exists as $CACHED never exists here and the file only exists if "setup_nix_ci" is called