Merge branch 'ci' into 'next'
ci: use attic.conduit.rs See merge request famedly/conduit!658
This commit is contained in:
commit
b4a60c3f9a
2 changed files with 18 additions and 10 deletions
|
@ -21,8 +21,8 @@ before_script:
|
||||||
- if command -v nix > /dev/null; then echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf; fi
|
- if command -v nix > /dev/null; then echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf; fi
|
||||||
|
|
||||||
# Add our own binary cache
|
# Add our own binary cache
|
||||||
- if command -v nix > /dev/null; then echo "extra-substituters = https://nix.computer.surgery/conduit" >> /etc/nix/nix.conf; fi
|
- if command -v nix > /dev/null; then echo "extra-substituters = https://attic.conduit.rs/conduit" >> /etc/nix/nix.conf; fi
|
||||||
- if command -v nix > /dev/null; then echo "extra-trusted-public-keys = conduit:ZGAf6P6LhNvnoJJ3Me3PRg7tlLSrPxcQ2RiE5LIppjo=" >> /etc/nix/nix.conf; fi
|
- if command -v nix > /dev/null; then echo "extra-trusted-public-keys = conduit:ddcaWZiWm0l0IXZlO8FERRdWvEufwmd0Negl1P+c0Ns=" >> /etc/nix/nix.conf; fi
|
||||||
|
|
||||||
# Add alternate binary cache
|
# Add alternate binary cache
|
||||||
- if command -v nix > /dev/null && [ -n "$ATTIC_ENDPOINT" ]; then echo "extra-substituters = $ATTIC_ENDPOINT" >> /etc/nix/nix.conf; fi
|
- if command -v nix > /dev/null && [ -n "$ATTIC_ENDPOINT" ]; then echo "extra-substituters = $ATTIC_ENDPOINT" >> /etc/nix/nix.conf; fi
|
||||||
|
@ -49,6 +49,9 @@ ci:
|
||||||
stage: ci
|
stage: ci
|
||||||
image: nixos/nix:2.20.4
|
image: nixos/nix:2.20.4
|
||||||
script:
|
script:
|
||||||
|
# Cache attic client
|
||||||
|
- ./bin/nix-build-and-cache --inputs-from . attic
|
||||||
|
|
||||||
# Cache the inputs required for the devShell
|
# Cache the inputs required for the devShell
|
||||||
- ./bin/nix-build-and-cache .#devShells.x86_64-linux.default.inputDerivation
|
- ./bin/nix-build-and-cache .#devShells.x86_64-linux.default.inputDerivation
|
||||||
|
|
||||||
|
|
|
@ -2,25 +2,30 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# The first argument must be the desired installable
|
# Build the installable and forward any other arguments too. Also, use
|
||||||
INSTALLABLE="$1"
|
# nix-output-monitor instead if it's available.
|
||||||
|
if command -v nom &> /dev/null; then
|
||||||
# Build the installable and forward any other arguments too
|
nom build "$@"
|
||||||
nix build "$@"
|
else
|
||||||
|
nix build "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -z ${ATTIC_TOKEN+x} ]; then
|
if [ ! -z ${ATTIC_TOKEN+x} ]; then
|
||||||
nix run --inputs-from . attic -- \
|
nix run --inputs-from . attic -- \
|
||||||
login \
|
login \
|
||||||
conduit \
|
conduit \
|
||||||
"${ATTIC_ENDPOINT:-https://nix.computer.surgery/conduit}" \
|
"${ATTIC_ENDPOINT:-https://attic.conduit.rs/conduit}" \
|
||||||
"$ATTIC_TOKEN"
|
"$ATTIC_TOKEN"
|
||||||
|
|
||||||
|
readarray -t outputs < <(nix path-info "$@")
|
||||||
|
readarray -t derivations < <(nix path-info "$@" --derivation)
|
||||||
|
|
||||||
# Push the target installable and its build dependencies
|
# Push the target installable and its build dependencies
|
||||||
nix run --inputs-from . attic -- \
|
nix run --inputs-from . attic -- \
|
||||||
push \
|
push \
|
||||||
conduit \
|
conduit \
|
||||||
"$(nix path-info "$INSTALLABLE" --derivation)" \
|
"${outputs[@]}" \
|
||||||
"$(nix path-info "$INSTALLABLE")"
|
"${derivations[@]}"
|
||||||
else
|
else
|
||||||
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
|
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue