aboutsummaryrefslogtreecommitdiff
path: root/tests/setup_gate.sh
blob: 7919f4ae95a370aa5d472428f4c1d28a63bb674b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

set -o xtrace
set -o errexit

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# 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

# Just for mandre :)
if [[ ! -f /etc/sudoers.d/jenkins ]]; then
    echo "jenkins ALL=(:docker) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/jenkins
fi

# This creates a logs directory for the devstack logs publisher
mkdir logs
# We symlink the logs dir to a known location
ln -s $(pwd)/logs /tmp/logs

distro=$(awk -F'[="]'+ '/^ID/ {print tolower($2); exit}' /etc/*-release)
exec tests/setup_${distro}.sh