2019-03-05 03:43:53 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
fail () {
|
|
|
|
echo "$@"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2019-04-26 03:05:16 +03:00
|
|
|
if [ -z "$CACHIX_SIGNING_KEY" ]
|
2019-07-15 21:36:56 +03:00
|
|
|
then fail "The CACHIX_SIGNING_KEY environment variable needs to be set."
|
2019-04-26 03:05:16 +03:00
|
|
|
fi
|
|
|
|
|
2019-03-05 03:43:53 +03:00
|
|
|
if [ -z "$CACHIX_AUTH_TOKEN" ]
|
|
|
|
then fail "The CACHIX_AUTH_TOKEN environment variable needs to be set."
|
|
|
|
fi
|
|
|
|
|
|
|
|
cleanup () {
|
|
|
|
rm -f .cache.list
|
|
|
|
}
|
|
|
|
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
2019-05-02 23:13:48 +03:00
|
|
|
set -ex
|
|
|
|
|
2019-03-05 03:43:53 +03:00
|
|
|
cachix authtoken "$CACHIX_AUTH_TOKEN" >/dev/null
|
2019-04-26 03:05:16 +03:00
|
|
|
cachix use urbit2
|
2019-05-02 23:13:48 +03:00
|
|
|
|
|
|
|
nix-build --no-out-link \
|
|
|
|
--max-jobs 2 \
|
|
|
|
nix/cachix/local.nix \
|
|
|
|
nix/cachix/release.nix \
|
|
|
|
> .cache.list
|
|
|
|
|
2019-04-26 03:05:16 +03:00
|
|
|
cachix push urbit2 < .cache.list
|