2019-03-05 03:43:53 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
fail () {
|
|
|
|
echo "$@"
|
2020-02-27 04:44:13 +03:00
|
|
|
if [ "$TRAVIS_PULL_REQUEST" = false ]
|
|
|
|
then exit 1
|
|
|
|
else exit 0
|
|
|
|
fi
|
2019-03-05 03:43:53 +03:00
|
|
|
}
|
|
|
|
|
2020-06-11 23:34:47 +03:00
|
|
|
cache=1
|
|
|
|
|
2019-04-26 03:05:16 +03:00
|
|
|
if [ -z "$CACHIX_SIGNING_KEY" ]
|
2020-06-11 23:34:47 +03:00
|
|
|
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" ]
|
2020-06-11 23:34:47 +03:00
|
|
|
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
|
|
|
|
|
2019-05-02 23:13:48 +03:00
|
|
|
set -ex
|
|
|
|
|
2020-06-11 23:34:47 +03:00
|
|
|
if [ $cache = 1 ]
|
|
|
|
then cachix authtoken "$CACHIX_AUTH_TOKEN" >/dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
cachix use urbit2 || true
|
2019-05-02 23:13:48 +03:00
|
|
|
|
2020-06-11 23:34:47 +03:00
|
|
|
build () {
|
|
|
|
nix-build --no-out-link --max-jobs 3 "$@" > .cache.list
|
|
|
|
if [ $cache = 1 ]
|
|
|
|
then cachix push urbit2 < .cache.list
|
|
|
|
fi
|
|
|
|
}
|
2019-05-02 23:13:48 +03:00
|
|
|
|
2020-06-11 23:34:47 +03:00
|
|
|
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
|