2014-09-21 11:09:35 +00:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
2016-06-27 21:29:12 +00:00
|
|
|
while test -n "$1"; do
|
2014-09-21 11:09:35 +00:00
|
|
|
|
2016-06-27 21:29:12 +00:00
|
|
|
# tell Travis to use folding
|
|
|
|
echo -en "travis_fold:start:$1\r"
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
|
|
|
|
verify)
|
|
|
|
echo "=== Verifying that nixpkgs evaluates..."
|
|
|
|
|
|
|
|
nix-env --file $TRAVIS_BUILD_DIR --query --available --json > /dev/null
|
|
|
|
;;
|
|
|
|
|
|
|
|
check)
|
|
|
|
echo "=== Checking NixOS options"
|
|
|
|
|
|
|
|
nix-build $TRAVIS_BUILD_DIR/nixos/release.nix --attr options --show-trace
|
|
|
|
;;
|
|
|
|
|
|
|
|
tarball)
|
|
|
|
echo "=== Checking tarball creation"
|
|
|
|
|
|
|
|
nix-build $TRAVIS_BUILD_DIR/pkgs/top-level/release.nix --attr tarball --show-trace
|
|
|
|
;;
|
|
|
|
|
|
|
|
pr)
|
|
|
|
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
|
|
|
echo "=== No pull request found"
|
|
|
|
else
|
|
|
|
echo "=== Building pull request #$TRAVIS_PULL_REQUEST"
|
|
|
|
|
2016-07-04 17:32:45 +00:00
|
|
|
token=""
|
|
|
|
if [ -n "$GITHUB_TOKEN" ]; then
|
|
|
|
token="--token $GITHUB_TOKEN"
|
|
|
|
fi
|
|
|
|
|
|
|
|
nix-shell --packages nox git --run "nox-review pr --slug $TRAVIS_REPO_SLUG $token $TRAVIS_PULL_REQUEST" -I nixpkgs=$TRAVIS_BUILD_DIR
|
2016-06-27 21:29:12 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Skipping unknown option $1"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo -en "travis_fold:end:$1\r"
|
|
|
|
shift
|
|
|
|
done
|