shrub/sh/cachix

52 lines
893 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
}
cache=1
2019-04-26 03:05:16 +03:00
if [ -z "$CACHIX_SIGNING_KEY" ]
then
echo "The CACHIX_SIGNING_KEY environment variable needs to be set."
echo "Disabling cachix uploads"
cache=0
2019-04-26 03:05:16 +03:00
fi
2019-03-05 03:43:53 +03:00
if [ -z "$CACHIX_AUTH_TOKEN" ]
then
echo "The CACHIX_AUTH_TOKEN environment variable needs to be set."
echo "Disabling cachix uploads"
cache=0
2019-03-05 03:43:53 +03:00
fi
cleanup () {
rm -f .cache.list
}
trap cleanup EXIT
set -ex
if [ $cache = 1 ]
then cachix authtoken "$CACHIX_AUTH_TOKEN" >/dev/null
fi
cachix use urbit2 || true
build () {
nix-build --no-out-link --max-jobs 3 "$@" > .cache.list
if [ $cache = 1 ]
then cachix push urbit2 < .cache.list
fi
}
time build nix/cachix/local.nix
#time build nix/cachix/tests.nix -A fakebus
time build nix/cachix/tests.nix -A results
time build nix/cachix/release.nix