forked from DGNum/infrastructure
feat(scripts): introduce manual push script
This way, we can send some closures if some of our members build them on more powerful machines. Signed-off-by: Ryan Lahfa <ryan@dgnum.eu>
This commit is contained in:
parent
f16d8ce68f
commit
25eee32a22
1 changed files with 37 additions and 0 deletions
37
scripts/push-to-cache.sh
Executable file
37
scripts/push-to-cache.sh
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
shopt -s lastpipe
|
||||
|
||||
output_path="$1"
|
||||
|
||||
if [ "$STORE_ENDPOINT" == "" ]; then
|
||||
echo "No endpoint given for the remote cache, uploading cannot take place."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$STORE_USER" == "" ]; then
|
||||
echo "No user given for the remote cache, uploading cannot take place."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$STORE_PASSWORD" == "" ]; then
|
||||
echo "No password given for the remote cache, uploading cannot take place."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat <<EOF >.netrc
|
||||
default
|
||||
login $STORE_USER
|
||||
password $STORE_PASSWORD
|
||||
EOF
|
||||
|
||||
nix copy \
|
||||
--extra-experimental-features nix-command \
|
||||
--to "$STORE_ENDPOINT?compression=none" \
|
||||
--netrc-file .netrc \
|
||||
"$output_path"
|
||||
|
||||
rm .netrc
|
Loading…
Reference in a new issue