diff --git a/.travis.yml b/.travis.yml index f03d4f361fa..ab571564867 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ before_install: - sudo apt-get update - sudo apt-get install -y docker-engine - sudo apt-get install -y qemu + - ./scripts/install_rkt.sh - ./scripts/install_consul.sh - ./scripts/install_vault.sh diff --git a/Vagrantfile b/Vagrantfile index 36853892bdd..cf9f451e999 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -60,6 +60,7 @@ cd /opt/gopath/src/github.com/hashicorp/nomad && make bootstrap # Install rkt, consul and vault bash scripts/install_rkt.sh +bash scripts/install_rkt_vagrant.sh bash scripts/install_consul.sh bash scripts/install_vault.sh diff --git a/scripts/install_rkt.sh b/scripts/install_rkt.sh index 9c3b60c1d60..22df0a5cf5c 100755 --- a/scripts/install_rkt.sh +++ b/scripts/install_rkt.sh @@ -2,29 +2,27 @@ set -ex -RKT_VERSION="v1.5.1" -RKT_SHA512="8163ca59fc8c44c9c2997431d16274d81d2e82ff2956c860607f4c111de744b78cdce716f8afbacf7173e0cdce25deac73ec95a30a8849bbf58d35faeb84e398" -DEST_DIR="/usr/local/bin" +RKT_VERSION="v1.17.0" +RKT_SHA512="30fd15716e148afa34ed28e6d5d778226e5e9761e9df3eb98f397cb2a7f3e3fc78e3dad2b717eee4157afc58183778cb1872aa82f3d05cc2bc9fb41193e81a7f" +CMD="cp" -sudo mkdir -p /etc/rkt/net.d -echo '{"name": "default", "type": "ptp", "ipMasq": false, "ipam": { "type": "host-local", "subnet": "172.16.28.0/24", "routes": [ { "dst": "0.0.0.0/0" } ] } }' | sudo tee -a /etc/rkt/net.d/99-network.conf +if [ ! -v DEST_DIR ]; then + DEST_DIR="/usr/local/bin" + CMD="sudo cp" +fi if [ ! -d "rkt-${RKT_VERSION}" ]; then printf "rkt-%s/ doesn't exist\n" "${RKT_VERSION}" if [ ! -f "rkt-${RKT_VERSION}.tar.gz" ]; then printf "Fetching rkt-%s.tar.gz\n" "${RKT_VERSION}" + echo "$RKT_SHA512 rkt-${RKT_VERSION}.tar.gz" > rkt-$RKT_VERSION.tar.gz.sha512sum wget https://github.com/coreos/rkt/releases/download/$RKT_VERSION/rkt-$RKT_VERSION.tar.gz - expected_version=$(printf 'SHA512(rkt-%s.tar.gz)= %s' "${RKT_VERSION}" "${RKT_SHA512}") - actual_version=$(openssl sha512 rkt-${RKT_VERSION}.tar.gz) - if [ "${expected_version}" != "${actual_version}" ]; then - printf "SHA512 of rkt-%s failed\n" "${RKT_VERSION}" - exit 1 - fi + sha512sum --check rkt-$RKT_VERSION.tar.gz.sha512sum tar xzvf rkt-$RKT_VERSION.tar.gz fi fi -sudo cp rkt-$RKT_VERSION/rkt $DEST_DIR -sudo cp rkt-$RKT_VERSION/*.aci $DEST_DIR +$CMD rkt-$RKT_VERSION/rkt $DEST_DIR +$CMD rkt-$RKT_VERSION/*.aci $DEST_DIR rkt version diff --git a/scripts/install_rkt_vagrant.sh b/scripts/install_rkt_vagrant.sh new file mode 100755 index 00000000000..679b6e15304 --- /dev/null +++ b/scripts/install_rkt_vagrant.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -ex + +# Configure rkt networking +sudo mkdir -p /etc/rkt/net.d +echo '{"name": "default", "type": "ptp", "ipMasq": false, "ipam": { "type": "host-local", "subnet": "172.16.28.0/24", "routes": [ { "dst": "0.0.0.0/0" } ] } }' | sudo tee -a /etc/rkt/net.d/99-network.conf + diff --git a/scripts/test.sh b/scripts/test.sh index d7058fdc1d3..f2baeba241f 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -12,6 +12,6 @@ go build -tags "nomad_test" -o $TEMPDIR/nomad || exit 1 # Run the tests echo "--> Running tests" GOBIN="`which go`" -sudo -E PATH=$TEMPDIR:$PATH -E GOPATH=$GOPATH \ +sudo -E PATH=$TEMPDIR:$PATH -E GOPATH=$GOPATH -E NOMAD_TEST_RKT=1 \ $GOBIN test -tags "nomad_test" ${GOTEST_FLAGS:--cover -timeout=900s} $($GOBIN list ./... | grep -v /vendor/)