mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
fix(scripts): remove nix substitutions from shell script
This commit is contained in:
parent
2bed4190a4
commit
a458a21c7b
2 changed files with 17 additions and 11 deletions
16
flake.nix
16
flake.nix
|
|
@ -116,11 +116,17 @@
|
||||||
};
|
};
|
||||||
copyToRoot = pkgs.buildEnv {
|
copyToRoot = pkgs.buildEnv {
|
||||||
name = "image-root";
|
name = "image-root";
|
||||||
paths = [
|
paths = with pkgs;
|
||||||
pkgs.gitMinimal
|
[
|
||||||
pkgs.gnugrep
|
gitMinimal
|
||||||
pkgs.cachix
|
gnugrep
|
||||||
pkgs.attic-client
|
gnused
|
||||||
|
busybox
|
||||||
|
diffutils
|
||||||
|
cachix
|
||||||
|
attic-client
|
||||||
|
]
|
||||||
|
++ [
|
||||||
setupScript
|
setupScript
|
||||||
finalizeScript
|
finalizeScript
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
echo -e "\\e[0Ksection_start:`date +%s`:finalize_nix_ci[collapsed=true]\\r\\e[0KFinalizing Nix CI..."
|
echo -e "\\e[0Ksection_start:`date +%s`:finalize_nix_ci[collapsed=true]\\r\\e[0KFinalizing Nix CI..."
|
||||||
nix path-info --all > /tmp/nix-store-after
|
nix path-info --all > /tmp/nix-store-after
|
||||||
echo "Finding new paths..."
|
echo "Finding new paths..."
|
||||||
NEW_PATHS=$(${pkgs.diffutils}/bin/diff --new-line-format="%L" \
|
NEW_PATHS=$(diff --new-line-format="%L" \
|
||||||
--old-line-format="" --unchanged-line-format="" \
|
--old-line-format="" --unchanged-line-format="" \
|
||||||
/tmp/nix-store-before /tmp/nix-store-after)
|
/tmp/nix-store-before /tmp/nix-store-after)
|
||||||
COUNT=$(${pkgs.busybox}/bin/wc -l <<<"$NEW_PATHS")
|
COUNT=$(wc -l <<<"$NEW_PATHS")
|
||||||
|
|
||||||
if [[ "$NIX_CI_CACHE_STRATEGY" == "auto" ]]; then
|
if [[ "$NIX_CI_CACHE_STRATEGY" == "auto" ]]; then
|
||||||
export NIX_CI_CACHE_STRATEGY="${NIX_CI_RUNNER_CACHE_STRATEGY:-${NIX_CI_DEFAULT_CACHE_STRATEGY:-none}}";
|
export NIX_CI_CACHE_STRATEGY="${NIX_CI_RUNNER_CACHE_STRATEGY:-${NIX_CI_DEFAULT_CACHE_STRATEGY:-none}}";
|
||||||
|
|
@ -17,7 +17,7 @@ echo -e "\\e[0Ksection_start:`date +%s`:finalize_nix_ci[collapsed=true]\\r\\e[0K
|
||||||
"runner")
|
"runner")
|
||||||
export RUNNER_CACHE=''${RUNNER_CACHE:-"file://$(pwd)/.nix-cache"}
|
export RUNNER_CACHE=''${RUNNER_CACHE:-"file://$(pwd)/.nix-cache"}
|
||||||
# add ^* to all store paths ending in .drv (prevent warning log spam)
|
# add ^* to all store paths ending in .drv (prevent warning log spam)
|
||||||
${pkgs.gnused}/bin/sed '/\.drv$/s/$/^*/' | nix copy --quiet --to "$RUNNER_CACHE" --stdin || true
|
sed '/\.drv$/s/$/^*/' | nix copy --quiet --to "$RUNNER_CACHE" --stdin || true
|
||||||
;;
|
;;
|
||||||
"attic")
|
"attic")
|
||||||
attic push --stdin ci:$ATTIC_CACHE || true
|
attic push --stdin ci:$ATTIC_CACHE || true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue