shrub/sh/cachix

37 lines
657 B
Plaintext
Raw Normal View History

2019-03-05 03:43:53 +03:00
#!/usr/bin/env bash
fail () {
echo "$@"
if [ "$TRAVIS_PULL_REQUEST" = false ]
then exit 1
else exit 0
fi
2019-03-05 03:43:53 +03:00
}
2019-04-26 03:05:16 +03:00
if [ -z "$CACHIX_SIGNING_KEY" ]
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
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
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