From 8e1b0f817a531a678884a90fbd56cc36b42bbbbd Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Fri, 14 Aug 2015 19:39:16 -0700 Subject: Setup the gate for cross-distro support Split the gate into two specific scripts to support multiple distros Add ubuntu script. Co-Authored-By: Steven Dake Change-Id: I23b9dee409b9e678422cd58525e1836541eb64da Partially-Implements: blueprint gate-source-builds --- tests/setup_gate.sh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'tests/setup_gate.sh') diff --git a/tests/setup_gate.sh b/tests/setup_gate.sh index c42095aef..5fdc62ec7 100755 --- a/tests/setup_gate.sh +++ b/tests/setup_gate.sh @@ -1,17 +1,22 @@ #!/bin/bash -set -e +set -o xtrace +set -o errexit -sudo yum install -y libffi-devel openssl-devel -sudo yum install -y http://yum.dockerproject.org/repo/main/fedora/21/Packages/docker-engine-1.7.1-1.fc21.x86_64.rpm -sudo systemctl start docker -sleep 1 +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -group_str="jenkins ALL=(:docker) NOPASSWD: ALL" -sudo grep -x "$group_str" /etc/sudoers > /dev/null || sudo bash -c "echo \"$group_str\" >> /etc/sudoers" +# TODO(SamYaple): This check could be much better, but should work for now +if [[ $(hostname | grep rax) ]]; then + export DEV="xvde" +else + echo "Assuming this is an hpcloud box" + export DEV="vdb" +fi -# disable ipv6 until we're sure routes to fedora mirrors work properly -sudo sh -c 'echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf' -sudo /usr/sbin/sysctl -p +# Just for mandre :) +if [[ ! -f /etc/sudoers.d/jenkins ]]; then + echo "jenkins ALL=(:docker) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/jenkins +fi -echo "Completed $0." +distro=$(awk -F'[="]'+ '/^ID/ {print tolower($2); exit}' /etc/*-release) +exec tests/setup_${distro}.sh -- cgit v1.2.3