mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 23:31:24 +01:00
This drastically reduces the maintenance burden. You may notice the `CODE_OF_CONDUCT.md` is deleted here. This is because I don't feel like updating the relevant parts and I don't think this will ever actually have a community build around it. If that changes for some reason, I'm not opposed to adding a code of conduct again.
26 lines
690 B
Bash
Executable file
26 lines
690 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 \
|
|
"$ATTIC_SERVER" \
|
|
"$ATTIC_ENDPOINT" \
|
|
"$ATTIC_TOKEN"
|
|
|
|
# Push the target installable and its build dependencies
|
|
nix run --inputs-from . attic -- \
|
|
push \
|
|
"$ATTIC_SERVER:$ATTIC_CACHE" \
|
|
"$(nix path-info "$INSTALLABLE" --derivation)" \
|
|
"$(nix path-info "$INSTALLABLE")"
|
|
else
|
|
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
|
|
fi
|