mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
chore(scripts): improve cache strategy handling, see #21
This commit is contained in:
parent
1e978a3edf
commit
d734853223
3 changed files with 17 additions and 3 deletions
|
|
@ -6,6 +6,10 @@ echo -e "\\e[0Ksection_start:`date +%s`:finalize_nix_ci[collapsed=true]\\r\\e[0K
|
|||
/tmp/nix-store-before /tmp/nix-store-after)
|
||||
COUNT=$(${pkgs.busybox}/bin/wc -l <<<"$NEW_PATHS")
|
||||
|
||||
if [[ "$NIX_CI_CACHE_STRATEGY" == "auto" ]]; then
|
||||
export NIX_CI_CACHE_STRATEGY="${NIX_CI_RUNNER_CACHE_STRATEGY:-${NIX_CI_DEFAULT_CACHE_STRATEGY:-none}}";
|
||||
fi
|
||||
|
||||
if [ -z "$NIX_CI_DISABLE_CACHE" ]; then
|
||||
echo -e "\\e[0Ksection_start:`date +%s`:cache_push[collapsed=true]\\r\\e[0KPushing $COUNT new store paths to cache ($NIX_CI_CACHE_STRATEGY)"
|
||||
echo $NEW_PATHS | {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
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
|
||||
|
||||
if [[ "$NIX_CI_CACHE_STRATEGY" == "auto" ]]; then
|
||||
export NIX_CI_CACHE_STRATEGY="${NIX_CI_RUNNER_CACHE_STRATEGY:-${NIX_CI_DEFAULT_CACHE_STRATEGY:-none}}";
|
||||
echo "NIX_CI_CACHE_STRATEGY was set to auto, selected '$NIX_CI_CACHE_STRATEGY' for this job"
|
||||
fi
|
||||
|
||||
if [ -z "$NIX_CI_DISABLE_CACHE" ]; then
|
||||
echo -e "\\e[0Ksection_start:`date +%s`:cache_setup[collapsed=true]\\r\\e[0KConfiguring cache ($NIX_CI_CACHE_STRATEGY)"
|
||||
case "$NIX_CI_CACHE_STRATEGY" in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue