shellcheck: fix lint of scripts in tests

This commit is contained in:
Otto Sabart
2022-08-16 21:00:00 +02:00
committed by Erik Arvstedt
parent a59c3b4b8a
commit f184bb34e6
14 changed files with 82 additions and 59 deletions

View File

@@ -6,21 +6,21 @@
set -euo pipefail
CACHIX_SIGNING_KEY=${CACHIX_SIGNING_KEY:-}
CACHIX_SIGNING_KEY="${CACHIX_SIGNING_KEY:-}"
cachixCache=nix-bitcoin
trap 'echo Error at line $LINENO' ERR
tmpDir=$(mktemp -d -p /tmp)
trap "rm -rf $tmpDir" EXIT
trap 'rm -rf $tmpDir' EXIT
## Instantiate
time nix-instantiate "$@" --add-root $tmpDir/drv --indirect > /dev/null
printf "instantiated "; realpath $tmpDir/drv
time nix-instantiate "$@" --add-root "$tmpDir/drv" --indirect > /dev/null
printf "instantiated "; realpath "$tmpDir/drv"
outPath=$(nix-store --query $tmpDir/drv)
if nix path-info --store https://$cachixCache.cachix.org $outPath &>/dev/null; then
outPath=$(nix-store --query "$tmpDir/drv")
if nix path-info --store "https://${cachixCache}.cachix.org" "$outPath" &>/dev/null; then
echo "$outPath has already been built successfully."
exit 0
fi
@@ -28,7 +28,7 @@ fi
## Build
if [[ -v CIRRUS_CI ]]; then
cachix use $cachixCache
cachix use "$cachixCache"
fi
if [[ $CACHIX_SIGNING_KEY ]]; then
@@ -38,10 +38,10 @@ else
buildCmd=nix-build
fi
$buildCmd --out-link $tmpDir/result $tmpDir/drv >/dev/null
$buildCmd --out-link "$tmpDir/result" "$tmpDir/drv" >/dev/null
if [[ $CACHIX_SIGNING_KEY ]]; then
cachix push $cachixCache $outPath
cachix push "$cachixCache" "$outPath"
fi
echo $outPath
echo "$outPath"

View File

@@ -16,4 +16,5 @@ if [[ -v CIRRUS_CI ]]; then
chmod o+rw /dev/kvm
fi
# shellcheck disable=SC2154
"${BASH_SOURCE[0]%/*}/../run-tests.sh" --ci --scenario "$scenario"