chore(utils): fix before_script getting overwritten and add collapsible sections

This commit is contained in:
technofab 2024-03-17 18:26:45 +01:00
parent 93baeca411
commit f460960ce6
2 changed files with 40 additions and 37 deletions

View file

@ -71,22 +71,22 @@
setupScript = extra_setup:
pkgs.writeShellScriptBin "setup_nix_ci" ''
echo -e "\\e[0Ksection_start:`date +%s`:nix_setup[collapsed=true]\\r\\e[0KSetting up Nix CI"
nix path-info --all > /tmp/nix-store-before
${extra_setup}
export NIX_CONF="
extra-trusted-public-keys = $NIX_PUBLIC_KEYS \n
extra-trusted-substituters = $NIX_SUBSTITUTERS \n
extra-substituters = $NIX_SUBSTITUTERS \n
$NIX_EXTRA_CONF
"
nix path-info --all > /tmp/nix-store-before
${extra_setup}
export NIX_CONF="
extra-trusted-public-keys = $NIX_PUBLIC_KEYS \n
extra-trusted-substituters = $NIX_SUBSTITUTERS \n
extra-substituters = $NIX_SUBSTITUTERS \n
$NIX_EXTRA_CONF
"
echo -e "\\e[0Ksection_end:`date +%s`:nix_setup\\r\\e[0K"
${
"" # load the job's deps only if the name was passed
}
if [[ ! -z $1 ]]; then
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)
nix build .#gitlab-ci-job-deps:$1
source $(readlink -f result)
echo -e "\\e[0Ksection_end:`date +%s`:nix_deps\\r\\e[0K"
fi
'';