mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-12-27 13:14:28 +01:00
ae69da635b
And also the public key so that pulling from the new endpoint will work. This allows other people to host their own attic instances and configure their (CI) environment to override the default endpoint so e.g. they can take advantage of a binary cache without having write access to the official one. I didn't actually test this change but I think it should work. Also why'd I format the script like that, ew lol
26 lines
701 B
Bash
Executable file
26 lines
701 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# The first argument must be the desired installable
|
|
INSTALLABLE="$1"
|
|
|
|
# Build the installable and forward any other arguments too
|
|
nix build "$@"
|
|
|
|
if [ ! -z ${ATTIC_TOKEN+x} ]; then
|
|
nix run --inputs-from . attic -- \
|
|
login \
|
|
conduit \
|
|
"${ATTIC_ENDPOINT:-https://nix.computer.surgery/conduit}" \
|
|
"$ATTIC_TOKEN"
|
|
|
|
# Push the target installable and its build dependencies
|
|
nix run --inputs-from . attic -- \
|
|
push \
|
|
conduit \
|
|
"$(nix path-info "$INSTALLABLE" --derivation)" \
|
|
"$(nix path-info "$INSTALLABLE")"
|
|
else
|
|
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
|
|
fi
|