mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-11-27 03:32:47 +00:00
32 lines
834 B
Plaintext
32 lines
834 B
Plaintext
|
#!/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 \
|
||
|
https://nix.computer.surgery/conduit \
|
||
|
"$ATTIC_TOKEN"
|
||
|
|
||
|
push_args=(
|
||
|
# Attic and its build dependencies
|
||
|
"$(nix path-info --inputs-from . attic)"
|
||
|
"$(nix path-info --inputs-from . attic --derivation)"
|
||
|
|
||
|
# The target installable and its build dependencies
|
||
|
"$(nix path-info "$INSTALLABLE" --derivation)"
|
||
|
"$(nix path-info "$INSTALLABLE")"
|
||
|
)
|
||
|
|
||
|
nix run --inputs-from . attic -- push conduit "${push_args[@]}"
|
||
|
else
|
||
|
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
|
||
|
fi
|