mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
chore: update gitlab-ci.yml and only load job deps if name was passed to setup_nix_ci
This commit is contained in:
parent
12e55ad0b7
commit
93baeca411
2 changed files with 12 additions and 7 deletions
14
flake.nix
14
flake.nix
|
|
@ -80,11 +80,15 @@
|
||||||
$NIX_EXTRA_CONF
|
$NIX_EXTRA_CONF
|
||||||
"
|
"
|
||||||
echo -e "\\e[0Ksection_end:`date +%s`:nix_setup\\r\\e[0K"
|
echo -e "\\e[0Ksection_end:`date +%s`:nix_setup\\r\\e[0K"
|
||||||
|
${
|
||||||
echo -e "\\e[0Ksection_start:`date +%s`:nix_deps[collapsed=true]\\r\\e[0KFetching deps for job"
|
"" # load the job's deps only if the name was passed
|
||||||
nix build .#gitlab-ci-job-deps:$1
|
}
|
||||||
source $(readlink -f result)
|
if [[ ! -z $1 ]]; then
|
||||||
echo -e "\\e[0Ksection_end:`date +%s`:nix_deps\\r\\e[0K"
|
echo -e "\\e[0Ksection_start:`date +%s`:nix_deps[collapsed=true]\\r\\e[0KFetching deps for job"
|
||||||
|
nix build .#gitlab-ci-job-deps:$1
|
||||||
|
source $(readlink -f result)
|
||||||
|
echo -e "\\e[0Ksection_end:`date +%s`:nix_deps\\r\\e[0K"
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
finalizeScript = push_command:
|
finalizeScript = push_command:
|
||||||
pkgs.writeShellScriptBin "finalize_nix_ci" ''
|
pkgs.writeShellScriptBin "finalize_nix_ci" ''
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,15 @@ stages:
|
||||||
nix-ci:build:
|
nix-ci:build:
|
||||||
stage: build
|
stage: build
|
||||||
image: registry.gitlab.com/technofab/nix-gitlab-ci/nix-ci:${NIX_CI_IMAGE_TAG}
|
image: registry.gitlab.com/technofab/nix-gitlab-ci/nix-ci:${NIX_CI_IMAGE_TAG}
|
||||||
|
before_script:
|
||||||
|
- source setup_nix_ci
|
||||||
script:
|
script:
|
||||||
# build the generated-gitlab-ci.yml
|
# build the generated-gitlab-ci.yml
|
||||||
- nix build .#gitlab-ci-config
|
- nix build .#gitlab-ci-config
|
||||||
- install result generated-gitlab-ci.yml
|
- install result generated-gitlab-ci.yml
|
||||||
after_script:
|
after_script:
|
||||||
# upload to binary cache
|
# upload to binary cache
|
||||||
- echo $(nix-store --query --references result)
|
- finalize_nix_ci
|
||||||
# TODO: upload deps using cachix or attic
|
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- generated-gitlab-ci.yml
|
- generated-gitlab-ci.yml
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue