nixpkgs/maintainers/scripts/travis-nox-review-pr.sh

36 lines
958 B
Bash
Raw Normal View History

2014-09-21 11:09:35 +00:00
#! /usr/bin/env bash
set -e
export NIX_CURL_FLAGS=-sS
2014-09-21 11:09:35 +00:00
# Install Nix
2014-10-14 12:54:14 +00:00
echo "=== Installing Nix..."
bash <(curl -sS https://nixos.org/nix/install) >/dev/null 2>&1
2014-09-21 11:09:35 +00:00
source $HOME/.nix-profile/etc/profile.d/nix.sh
# Make sure we can use hydra's binary cache
sudo mkdir /etc/nix
2014-10-14 12:54:14 +00:00
sudo tee /etc/nix/nix.conf <<EOF >/dev/null
binary-caches = http://cache.nixos.org http://hydra.nixos.org
trusted-binary-caches = http://hydra.nixos.org
build-max-jobs = 4
EOF
2014-09-21 11:09:35 +00:00
2014-10-14 12:54:14 +00:00
echo "=== Checking evaluation, including meta"
nix-env -f. -qa --json >/dev/null
2014-09-21 11:09:35 +00:00
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
2014-10-14 12:54:14 +00:00
echo "===> Not a pull request, checking evaluation"
nix-build pkgs/top-level/release.nix -A tarball
2014-09-21 11:09:35 +00:00
exit 0
fi
2014-10-14 12:54:14 +00:00
echo "=== Installing nox"
git clone -q https://github.com/madjar/nox
pip --quiet install -e nox
2014-09-21 11:09:35 +00:00
2014-10-14 12:54:14 +00:00
echo "=== Reviewing PR"
2014-09-21 11:09:35 +00:00
# The current HEAD is the PR merged into origin/master, so we compare
# against origin/master
nox-review wip --against origin/master