commit
28c6779856
18 changed files with 619 additions and 9 deletions
|
@ -90,9 +90,10 @@ GUEST_CORES=${GUEST_CORES:-1}
|
|||
|
||||
# libvirt.xml configuration
|
||||
NET_XML=$vm_dir/net.xml
|
||||
NET_NAME=${NET_NAME:-devstack-$GUEST_NETWORK}
|
||||
cat > $NET_XML <<EOF
|
||||
<network>
|
||||
<name>devstack-$GUEST_NETWORK</name>
|
||||
<name>$NET_NAME</name>
|
||||
<bridge name="stackbr%d" />
|
||||
<forward/>
|
||||
<ip address="$GUEST_GATEWAY" netmask="$GUEST_NETMASK">
|
||||
|
@ -104,9 +105,9 @@ cat > $NET_XML <<EOF
|
|||
EOF
|
||||
|
||||
if [[ "$GUEST_RECREATE_NET" == "yes" ]]; then
|
||||
virsh net-destroy devstack-$GUEST_NETWORK || true
|
||||
virsh net-destroy $NET_NAME || true
|
||||
# destroying the network isn't enough to delete the leases
|
||||
rm -f /var/lib/libvirt/dnsmasq/devstack-$GUEST_NETWORK.leases
|
||||
rm -f /var/lib/libvirt/dnsmasq/$NET_NAME.leases
|
||||
virsh net-create $vm_dir/net.xml
|
||||
fi
|
||||
|
||||
|
@ -134,7 +135,7 @@ cat > $LIBVIRT_XML <<EOF
|
|||
</disk>
|
||||
|
||||
<interface type='network'>
|
||||
<source network='devstack-$GUEST_NETWORK'/>
|
||||
<source network='$NET_NAME'/>
|
||||
</interface>
|
||||
|
||||
<!-- The order is significant here. File must be defined first -->
|
||||
|
@ -170,7 +171,7 @@ instance-type: m1.ignore
|
|||
local-hostname: $GUEST_NAME.local
|
||||
EOF
|
||||
|
||||
# set metadata
|
||||
# set user-data
|
||||
cat > $vm_dir/uec/user-data<<EOF
|
||||
#!/bin/bash
|
||||
# hostname needs to resolve for rabbit
|
||||
|
@ -186,6 +187,33 @@ cat > localrc <<LOCAL_EOF
|
|||
ROOTSLEEP=0
|
||||
`cat $TOP_DIR/localrc`
|
||||
LOCAL_EOF
|
||||
# Disable byobu
|
||||
/usr/bin/byobu-disable
|
||||
EOF
|
||||
|
||||
# Setup stack user with our key
|
||||
CONFIGURE_STACK_USER=${CONFIGURE_STACK_USER:-yes}
|
||||
if [[ -e ~/.ssh/id_rsa.pub && "$CONFIGURE_STACK_USER" = "yes" ]]; then
|
||||
PUB_KEY=`cat ~/.ssh/id_rsa.pub`
|
||||
cat >> $vm_dir/uec/user-data<<EOF
|
||||
mkdir -p /opt/stack
|
||||
useradd -U -G sudo -s /bin/bash -d /opt/stack -m stack
|
||||
echo stack:pass | chpasswd
|
||||
mkdir -p /opt/stack/.ssh
|
||||
echo "$PUB_KEY" > /opt/stack/.ssh/authorized_keys
|
||||
chown -R stack /opt/stack
|
||||
chmod 700 /opt/stack/.ssh
|
||||
chmod 600 /opt/stack/.ssh/authorized_keys
|
||||
|
||||
grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers ||
|
||||
echo "#includedir /etc/sudoers.d" >> /etc/sudoers
|
||||
( umask 226 && echo "stack ALL=(ALL) NOPASSWD:ALL" \
|
||||
> /etc/sudoers.d/50_stack_sh )
|
||||
EOF
|
||||
fi
|
||||
|
||||
# Run stack.sh
|
||||
cat >> $vm_dir/uec/user-data<<EOF
|
||||
./stack.sh
|
||||
EOF
|
||||
|
||||
|
|
38
tools/jenkins/README.md
Normal file
38
tools/jenkins/README.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
Getting Started With Jenkins and Devstack
|
||||
=========================================
|
||||
This little corner of devstack is to show how to get an Openstack jenkins
|
||||
environment up and running quickly, using the rcb configuration methodology.
|
||||
|
||||
|
||||
To create a jenkins server
|
||||
--------------------------
|
||||
|
||||
cd tools/jenkins/jenkins_home
|
||||
./build_jenkins.sh
|
||||
|
||||
This will create a jenkins environment configured with sample test scripts that run against xen and kvm.
|
||||
|
||||
Configuring XS
|
||||
--------------
|
||||
In order to make the tests for XS work, you must install xs 5.6 on a separate machine,
|
||||
and install the the jenkins public key on that server. You then need to create the
|
||||
/var/lib/jenkins/xenrc on your jenkins server like so:
|
||||
|
||||
MYSQL_PASSWORD=secrete
|
||||
SERVICE_TOKEN=secrete
|
||||
ADMIN_PASSWORD=secrete
|
||||
RABBIT_PASSWORD=secrete
|
||||
# This is the password for your guest (for both stack and root users)
|
||||
GUEST_PASSWORD=secrete
|
||||
# Do not download the usual images yet!
|
||||
IMAGE_URLS=""
|
||||
FLOATING_RANGE=192.168.1.224/28
|
||||
VIRT_DRIVER=xenserver
|
||||
# Explicitly set multi-host
|
||||
MULTI_HOST=1
|
||||
# Give extra time for boot
|
||||
ACTIVE_TIMEOUT=45
|
||||
# IMPORTANT: This is the ip of your xenserver
|
||||
XEN_IP=10.5.5.1
|
||||
# IMPORTANT: The following must be set to your dom0 root password!
|
||||
XENAPI_PASSWORD='MY_XEN_ROOT_PW'
|
8
tools/jenkins/adapters/euca.sh
Executable file
8
tools/jenkins/adapters/euca.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
# Echo commands, exit on error
|
||||
set -o xtrace
|
||||
set -o errexit
|
||||
|
||||
TOP_DIR=$(cd ../../.. && pwd)
|
||||
HEAD_IP=`cat $TOP_DIR/addresses | grep HEAD | cut -d "=" -f2`
|
||||
ssh stack@$HEAD_IP 'cd devstack && source openrc && cd exercises && ./euca.sh'
|
8
tools/jenkins/adapters/floating_ips.sh
Executable file
8
tools/jenkins/adapters/floating_ips.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
# Echo commands, exit on error
|
||||
set -o xtrace
|
||||
set -o errexit
|
||||
|
||||
TOP_DIR=$(cd ../../.. && pwd)
|
||||
HEAD_IP=`cat $TOP_DIR/addresses | grep HEAD | cut -d "=" -f2`
|
||||
ssh stack@$HEAD_IP 'cd devstack && source openrc && cd exercises && ./floating_ips.sh'
|
21
tools/jenkins/build_configuration.sh
Executable file
21
tools/jenkins/build_configuration.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
EXECUTOR_NUMBER=$1
|
||||
CONFIGURATION=$2
|
||||
ADAPTER=$3
|
||||
RC=$4
|
||||
|
||||
function usage() {
|
||||
echo "Usage: $0 - Build a configuration"
|
||||
echo ""
|
||||
echo "$0 [EXECUTOR_NUMBER] [CONFIGURATION] [ADAPTER] [RC (optional)]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Validate inputs
|
||||
if [[ "$EXECUTOR_NUMBER" = "" || "$CONFIGURATION" = "" || "$ADAPTER" = "" ]]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
# Execute configuration script
|
||||
cd configurations && ./$CONFIGURATION.sh $EXECUTOR_NUMBER $CONFIGURATION $ADAPTER "$RC"
|
56
tools/jenkins/configurations/kvm.sh
Executable file
56
tools/jenkins/configurations/kvm.sh
Executable file
|
@ -0,0 +1,56 @@
|
|||
#!/bin/bash
|
||||
|
||||
EXECUTOR_NUMBER=$1
|
||||
CONFIGURATION=$2
|
||||
ADAPTER=$3
|
||||
RC=$4
|
||||
|
||||
function usage() {
|
||||
echo "Usage: $0 - Build a test configuration"
|
||||
echo ""
|
||||
echo "$0 [EXECUTOR_NUMBER] [CONFIGURATION] [ADAPTER] [RC (optional)]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Validate inputs
|
||||
if [[ "$EXECUTOR_NUMBER" = "" || "$CONFIGURATION" = "" || "$ADAPTER" = "" ]]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
# This directory
|
||||
CUR_DIR=$(cd $(dirname "$0") && pwd)
|
||||
|
||||
# devstack directory
|
||||
cd ../../..
|
||||
TOP_DIR=$(pwd)
|
||||
|
||||
# Name test instance based on executor
|
||||
BASE_NAME=executor-`printf "%02d" $EXECUTOR_NUMBER`
|
||||
GUEST_NAME=$BASE_NAME.$ADAPTER
|
||||
virsh list | grep $BASE_NAME | cut -d " " -f1 | xargs -n 1 virsh destroy || true
|
||||
virsh net-list | grep $BASE_NAME | cut -d " " -f1 | xargs -n 1 virsh net-destroy || true
|
||||
|
||||
# Configure localrc
|
||||
cat <<EOF >localrc
|
||||
RECLONE=yes
|
||||
GUEST_NETWORK=$EXECUTOR_NUMBER
|
||||
GUEST_NAME=$GUEST_NAME
|
||||
FLOATING_RANGE=192.168.$EXECUTOR_NUMBER.128/27
|
||||
GUEST_CORES=1
|
||||
GUEST_RAM=12574720
|
||||
MYSQL_PASSWORD=chicken
|
||||
RABBIT_PASSWORD=chicken
|
||||
SERVICE_TOKEN=chicken
|
||||
ADMIN_PASSWORD=chicken
|
||||
USERNAME=admin
|
||||
TENANT=admin
|
||||
NET_NAME=$BASE_NAME
|
||||
ACTIVE_TIMEOUT=45
|
||||
BOOT_TIMEOUT=45
|
||||
$RC
|
||||
EOF
|
||||
cd tools
|
||||
sudo ./build_uec.sh
|
||||
|
||||
# Make the address of the instances available to test runners
|
||||
echo HEAD=`cat /var/lib/libvirt/dnsmasq/$BASE_NAME.leases | cut -d " " -f3` > $TOP_DIR/addresses
|
53
tools/jenkins/configurations/xs.sh
Executable file
53
tools/jenkins/configurations/xs.sh
Executable file
|
@ -0,0 +1,53 @@
|
|||
#!/bin/bash
|
||||
set -o errexit
|
||||
set -o xtrace
|
||||
|
||||
|
||||
EXECUTOR_NUMBER=$1
|
||||
CONFIGURATION=$2
|
||||
ADAPTER=$3
|
||||
RC=$4
|
||||
|
||||
function usage() {
|
||||
echo "Usage: $0 - Build a test configuration"
|
||||
echo ""
|
||||
echo "$0 [EXECUTOR_NUMBER] [CONFIGURATION] [ADAPTER] [RC (optional)]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Validate inputs
|
||||
if [[ "$EXECUTOR_NUMBER" = "" || "$CONFIGURATION" = "" || "$ADAPTER" = "" ]]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
# Configuration of xenrc
|
||||
XENRC=/var/lib/jenkins/xenrc
|
||||
if [ ! -e $XENRC ]; then
|
||||
echo "/var/lib/jenkins/xenrc is not present! See README.md"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Move to top of devstack
|
||||
cd ../../..
|
||||
|
||||
# Use xenrc as the start of our localrc
|
||||
cp $XENRC localrc
|
||||
|
||||
# Set the PUB_IP
|
||||
PUB_IP=192.168.1.1$EXECUTOR_NUMBER
|
||||
echo "PUB_IP=$PUB_IP" >> localrc
|
||||
|
||||
# Overrides
|
||||
echo "$RC" >> localrc
|
||||
|
||||
# Source localrc
|
||||
. localrc
|
||||
|
||||
# Make host ip available to tester
|
||||
echo "HEAD=$PUB_IP" > addresses
|
||||
|
||||
# Build configuration
|
||||
REMOTE_DEVSTACK=/root/devstack
|
||||
ssh root@$XEN_IP "rm -rf $REMOTE_DEVSTACK"
|
||||
scp -pr . root@$XEN_IP:$REMOTE_DEVSTACK
|
||||
ssh root@$XEN_IP "cd $REMOTE_DEVSTACK/tools/xen && ./build_domU.sh"
|
3
tools/jenkins/jenkins_home/.gitignore
vendored
Normal file
3
tools/jenkins/jenkins_home/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
builds
|
||||
workspace
|
||||
*.sw*
|
108
tools/jenkins/jenkins_home/build_jenkins.sh
Executable file
108
tools/jenkins/jenkins_home/build_jenkins.sh
Executable file
|
@ -0,0 +1,108 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Echo commands, exit on error
|
||||
set -o xtrace
|
||||
set -o errexit
|
||||
|
||||
# Make sure only root can run our script
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "This script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure user has configured an ssh pubkey
|
||||
if [ ! -e /root/.ssh/id_rsa.pub ]; then
|
||||
echo "Public key is missing. This is used to ssh into your instances."
|
||||
echo "Please run ssh-keygen before proceeding"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# This directory
|
||||
CUR_DIR=$(cd $(dirname "$0") && pwd)
|
||||
|
||||
# Configure trunk jenkins!
|
||||
echo "deb http://pkg.jenkins-ci.org/debian binary/" > /etc/apt/sources.list.d/jenkins.list
|
||||
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
|
||||
apt-get update
|
||||
|
||||
|
||||
# Clean out old jenkins - useful if you are having issues upgrading
|
||||
CLEAN_JENKINS=${CLEAN_JENKINS:-no}
|
||||
if [ "$CLEAN_JENKINS" = "yes" ] then;
|
||||
apt-get remove jenkins jenkins-common
|
||||
fi
|
||||
|
||||
# Install software
|
||||
DEPS="jenkins cloud-utils"
|
||||
apt-get install -y --force-yes $DEPS
|
||||
|
||||
# Install jenkins
|
||||
if [ ! -e /var/lib/jenkins ]; then
|
||||
echo "Jenkins installation failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Setup sudo
|
||||
JENKINS_SUDO=/etc/sudoers.d/jenkins
|
||||
cat > $JENKINS_SUDO <<EOF
|
||||
jenkins ALL = NOPASSWD: ALL
|
||||
EOF
|
||||
chmod 440 $JENKINS_SUDO
|
||||
|
||||
# Setup .gitconfig
|
||||
JENKINS_GITCONF=/var/lib/jenkins/hudson.plugins.git.GitSCM.xml
|
||||
cat > $JENKINS_GITCONF <<EOF
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<hudson.plugins.git.GitSCM_-DescriptorImpl>
|
||||
<generation>4</generation>
|
||||
<globalConfigName>Jenkins</globalConfigName>
|
||||
<globalConfigEmail>jenkins@rcb.me</globalConfigEmail>
|
||||
</hudson.plugins.git.GitSCM_-DescriptorImpl>
|
||||
EOF
|
||||
|
||||
# Add build numbers
|
||||
JOBS=`ls jobs`
|
||||
for job in ${JOBS// / }; do
|
||||
if [ ! -e jobs/$job/nextBuildNumber ]; then
|
||||
echo 1 > jobs/$job/nextBuildNumber
|
||||
fi
|
||||
done
|
||||
|
||||
# Set ownership to jenkins
|
||||
chown -R jenkins $CUR_DIR
|
||||
|
||||
# Make sure this directory is accessible to jenkins
|
||||
if ! su -c "ls $CUR_DIR" jenkins; then
|
||||
echo "Your devstack directory is not accessible by jenkins."
|
||||
echo "There is a decent chance you are trying to run this from a directory in /root."
|
||||
echo "If so, try moving devstack elsewhere (eg. /opt/devstack)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Move aside old jobs, if present
|
||||
if [ ! -h /var/lib/jenkins/jobs ]; then
|
||||
echo "Installing jobs symlink"
|
||||
if [ -d /var/lib/jenkins/jobs ]; then
|
||||
mv /var/lib/jenkins/jobs /var/lib/jenkins/jobs.old
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set up jobs symlink
|
||||
rm -f /var/lib/jenkins/jobs
|
||||
ln -s $CUR_DIR/jobs /var/lib/jenkins/jobs
|
||||
|
||||
# List of plugins
|
||||
PLUGINS=http://hudson-ci.org/downloads/plugins/build-timeout/1.6/build-timeout.hpi,http://mirrors.jenkins-ci.org/plugins/git/1.1.12/git.hpi,http://hudson-ci.org/downloads/plugins/global-build-stats/1.2/global-build-stats.hpi,http://hudson-ci.org/downloads/plugins/greenballs/1.10/greenballs.hpi,http://download.hudson-labs.org/plugins/console-column-plugin/1.0/console-column-plugin.hpi
|
||||
|
||||
# Configure plugins
|
||||
for plugin in ${PLUGINS//,/ }; do
|
||||
name=`basename $plugin`
|
||||
dest=/var/lib/jenkins/plugins/$name
|
||||
if [ ! -e $dest ]; then
|
||||
curl -L $plugin -o $dest
|
||||
fi
|
||||
done
|
||||
|
||||
# Restart jenkins
|
||||
/etc/init.d/jenkins stop || true
|
||||
/etc/init.d/jenkins start
|
21
tools/jenkins/jenkins_home/clean.sh
Executable file
21
tools/jenkins/jenkins_home/clean.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
# This script is not yet for general consumption.
|
||||
|
||||
set -o errexit
|
||||
|
||||
if [ ! "$FORCE" = "yes" ]; then
|
||||
echo "FORCE not set to 'yes'. Make sure this is something you really want to do. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
virsh list | cut -d " " -f1 | grep -v "-" | egrep -e "[0-9]" | xargs -n 1 virsh destroy || true
|
||||
virsh net-list | grep active | cut -d " " -f1 | xargs -n 1 virsh net-destroy || true
|
||||
killall dnsmasq || true
|
||||
if [ "$CLEAN" = "yes" ]; then
|
||||
rm -rf jobs
|
||||
fi
|
||||
rm /var/lib/jenkins/jobs
|
||||
git checkout -f
|
||||
git fetch
|
||||
git merge origin/jenkins
|
||||
./build_jenkins.sh
|
82
tools/jenkins/jenkins_home/jobs/diablo-kvm_ha/config.xml
Normal file
82
tools/jenkins/jenkins_home/jobs/diablo-kvm_ha/config.xml
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<matrix-project>
|
||||
<actions/>
|
||||
<description></description>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<properties>
|
||||
<hudson.model.ParametersDefinitionProperty>
|
||||
<parameterDefinitions>
|
||||
<hudson.model.StringParameterDefinition>
|
||||
<name>RC</name>
|
||||
<description></description>
|
||||
<defaultValue></defaultValue>
|
||||
</hudson.model.StringParameterDefinition>
|
||||
</parameterDefinitions>
|
||||
</hudson.model.ParametersDefinitionProperty>
|
||||
</properties>
|
||||
<scm class="hudson.plugins.git.GitSCM">
|
||||
<configVersion>2</configVersion>
|
||||
<userRemoteConfigs>
|
||||
<hudson.plugins.git.UserRemoteConfig>
|
||||
<name>origin</name>
|
||||
<refspec>+refs/heads/*:refs/remotes/origin/*</refspec>
|
||||
<url>git://github.com/cloudbuilders/devstack.git</url>
|
||||
</hudson.plugins.git.UserRemoteConfig>
|
||||
</userRemoteConfigs>
|
||||
<branches>
|
||||
<hudson.plugins.git.BranchSpec>
|
||||
<name>jenkins</name>
|
||||
</hudson.plugins.git.BranchSpec>
|
||||
</branches>
|
||||
<recursiveSubmodules>false</recursiveSubmodules>
|
||||
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
|
||||
<authorOrCommitter>false</authorOrCommitter>
|
||||
<clean>false</clean>
|
||||
<wipeOutWorkspace>false</wipeOutWorkspace>
|
||||
<pruneBranches>false</pruneBranches>
|
||||
<remotePoll>false</remotePoll>
|
||||
<buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
|
||||
<gitTool>Default</gitTool>
|
||||
<submoduleCfg class="list"/>
|
||||
<relativeTargetDir></relativeTargetDir>
|
||||
<excludedRegions></excludedRegions>
|
||||
<excludedUsers></excludedUsers>
|
||||
<gitConfigName></gitConfigName>
|
||||
<gitConfigEmail></gitConfigEmail>
|
||||
<skipTag>false</skipTag>
|
||||
<scmName></scmName>
|
||||
</scm>
|
||||
<canRoam>true</canRoam>
|
||||
<disabled>false</disabled>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<triggers class="vector"/>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<axes>
|
||||
<hudson.matrix.TextAxis>
|
||||
<name>ADAPTER</name>
|
||||
<values>
|
||||
<string>euca</string>
|
||||
<string>floating_ips</string>
|
||||
</values>
|
||||
</hudson.matrix.TextAxis>
|
||||
</axes>
|
||||
<builders>
|
||||
<hudson.tasks.Shell>
|
||||
<command>sed -i 's/) 2>&1 | tee "${LOGFILE}"/)/' stack.sh</command>
|
||||
</hudson.tasks.Shell>
|
||||
<hudson.tasks.Shell>
|
||||
<command>set -o errexit
|
||||
cd tools/jenkins
|
||||
sudo ./build_configuration.sh $EXECUTOR_NUMBER kvm $ADAPTER "$RC"</command>
|
||||
</hudson.tasks.Shell>
|
||||
<hudson.tasks.Shell>
|
||||
<command>set -o errexit
|
||||
cd tools/jenkins
|
||||
sudo ./run_test.sh $EXECUTOR_NUMBER $ADAPTER $RC "$RC"</command>
|
||||
</hudson.tasks.Shell>
|
||||
</builders>
|
||||
<publishers/>
|
||||
<buildWrappers/>
|
||||
<runSequentially>false</runSequentially>
|
||||
</matrix-project>
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<matrix-config>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<properties/>
|
||||
<scm class="hudson.scm.NullSCM"/>
|
||||
<canRoam>false</canRoam>
|
||||
<disabled>false</disabled>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<triggers class="vector"/>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<builders/>
|
||||
<publishers/>
|
||||
<buildWrappers/>
|
||||
</matrix-config>
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<matrix-config>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<properties/>
|
||||
<scm class="hudson.scm.NullSCM"/>
|
||||
<canRoam>false</canRoam>
|
||||
<disabled>false</disabled>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<triggers class="vector"/>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<builders/>
|
||||
<publishers/>
|
||||
<buildWrappers/>
|
||||
</matrix-config>
|
88
tools/jenkins/jenkins_home/jobs/diablo-xs_ha/config.xml
Normal file
88
tools/jenkins/jenkins_home/jobs/diablo-xs_ha/config.xml
Normal file
|
@ -0,0 +1,88 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<matrix-project>
|
||||
<actions/>
|
||||
<description>In order for this to work, you must create a /var/lib/jenkins/xenrc file as described in README.md</description>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<properties>
|
||||
<hudson.model.ParametersDefinitionProperty>
|
||||
<parameterDefinitions>
|
||||
<hudson.model.StringParameterDefinition>
|
||||
<name>RC</name>
|
||||
<description></description>
|
||||
<defaultValue></defaultValue>
|
||||
</hudson.model.StringParameterDefinition>
|
||||
</parameterDefinitions>
|
||||
</hudson.model.ParametersDefinitionProperty>
|
||||
</properties>
|
||||
<scm class="hudson.plugins.git.GitSCM">
|
||||
<configVersion>2</configVersion>
|
||||
<userRemoteConfigs>
|
||||
<hudson.plugins.git.UserRemoteConfig>
|
||||
<name>origin</name>
|
||||
<refspec>+refs/heads/*:refs/remotes/origin/*</refspec>
|
||||
<url>git://github.com/cloudbuilders/devstack.git</url>
|
||||
</hudson.plugins.git.UserRemoteConfig>
|
||||
</userRemoteConfigs>
|
||||
<branches>
|
||||
<hudson.plugins.git.BranchSpec>
|
||||
<name>jenkins</name>
|
||||
</hudson.plugins.git.BranchSpec>
|
||||
</branches>
|
||||
<recursiveSubmodules>false</recursiveSubmodules>
|
||||
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
|
||||
<authorOrCommitter>false</authorOrCommitter>
|
||||
<clean>false</clean>
|
||||
<wipeOutWorkspace>false</wipeOutWorkspace>
|
||||
<pruneBranches>false</pruneBranches>
|
||||
<remotePoll>false</remotePoll>
|
||||
<buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
|
||||
<gitTool>Default</gitTool>
|
||||
<submoduleCfg class="list"/>
|
||||
<relativeTargetDir></relativeTargetDir>
|
||||
<excludedRegions></excludedRegions>
|
||||
<excludedUsers></excludedUsers>
|
||||
<gitConfigName></gitConfigName>
|
||||
<gitConfigEmail></gitConfigEmail>
|
||||
<skipTag>false</skipTag>
|
||||
<scmName></scmName>
|
||||
</scm>
|
||||
<canRoam>true</canRoam>
|
||||
<disabled>false</disabled>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<triggers class="vector"/>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<axes>
|
||||
<hudson.matrix.TextAxis>
|
||||
<name>ADAPTER</name>
|
||||
<values>
|
||||
<string>euca</string>
|
||||
<string>floating_ips</string>
|
||||
</values>
|
||||
</hudson.matrix.TextAxis>
|
||||
</axes>
|
||||
<builders>
|
||||
<hudson.tasks.Shell>
|
||||
<command>sed -i 's/) 2>&1 | tee "${LOGFILE}"/)/' stack.sh</command>
|
||||
</hudson.tasks.Shell>
|
||||
<hudson.tasks.Shell>
|
||||
<command>set -o errexit
|
||||
cd tools/jenkins
|
||||
sudo ./build_configuration.sh $EXECUTOR_NUMBER xs $ADAPTER "$RC"</command>
|
||||
</hudson.tasks.Shell>
|
||||
<hudson.tasks.Shell>
|
||||
<command>#!/bin/bash
|
||||
set -o errexit
|
||||
set -o xtrace
|
||||
|
||||
. localrc
|
||||
|
||||
# Unlike kvm, ssh to the xen host to run tests, in case the test instance is launch with a host only network
|
||||
ssh root@$XEN_IP "cd devstack && . localrc && cd tools/jenkins && ./run_test.sh $EXECUTOR_NUMBER $ADAPTER '$RC'"
|
||||
</command>
|
||||
</hudson.tasks.Shell>
|
||||
</builders>
|
||||
<publishers/>
|
||||
<buildWrappers/>
|
||||
<runSequentially>true</runSequentially>
|
||||
</matrix-project>
|
45
tools/jenkins/jenkins_home/print_summary.py
Executable file
45
tools/jenkins/jenkins_home/print_summary.py
Executable file
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/python
|
||||
import urllib
|
||||
import json
|
||||
import sys
|
||||
|
||||
|
||||
def print_usage():
|
||||
print "Usage: %s [jenkins_url (eg. http://50.56.12.202:8080/)]"\
|
||||
% sys.argv[0]
|
||||
sys.exit()
|
||||
|
||||
|
||||
def fetch_blob(url):
|
||||
return json.loads(urllib.urlopen(url + '/api/json').read())
|
||||
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print_usage()
|
||||
|
||||
BASE_URL = sys.argv[1]
|
||||
|
||||
root = fetch_blob(BASE_URL)
|
||||
results = {}
|
||||
for job_url in root['jobs']:
|
||||
job = fetch_blob(job_url['url'])
|
||||
if job.get('activeConfigurations'):
|
||||
(tag, name) = job['name'].split('-')
|
||||
if not results.get(tag):
|
||||
results[tag] = {}
|
||||
if not results[tag].get(name):
|
||||
results[tag][name] = []
|
||||
|
||||
for config_url in job['activeConfigurations']:
|
||||
config = fetch_blob(config_url['url'])
|
||||
|
||||
log_url = ''
|
||||
if config.get('lastBuild'):
|
||||
log_url = config['lastBuild']['url'] + 'console'
|
||||
|
||||
results[tag][name].append({'test': config['displayName'],
|
||||
'status': config['color'],
|
||||
'logUrl': log_url,
|
||||
'healthReport': config['healthReport']})
|
||||
|
||||
print json.dumps(results)
|
20
tools/jenkins/run_test.sh
Executable file
20
tools/jenkins/run_test.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
EXECUTOR_NUMBER=$1
|
||||
ADAPTER=$2
|
||||
RC=$3
|
||||
|
||||
function usage() {
|
||||
echo "Usage: $0 - Run a test"
|
||||
echo ""
|
||||
echo "$0 [EXECUTOR_NUMBER] [ADAPTER] [RC (optional)]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Validate inputs
|
||||
if [[ "$EXECUTOR_NUMBER" = "" || "$ADAPTER" = "" ]]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
# Execute configuration script
|
||||
cd adapters && ./$ADAPTER.sh $EXECUTOR_NUMBER $ADAPTER "$RC"
|
|
@ -49,10 +49,6 @@ grep -q "^#includedir.*/etc/sudoers.d" $STAGING_DIR/etc/sudoers ||
|
|||
cp $TOP_DIR/files/sudo/* $STAGING_DIR/etc/sudoers.d/
|
||||
sed -e "s,%USER%,$USER,g" -i $STAGING_DIR/etc/sudoers.d/*
|
||||
|
||||
# and has sudo ability (in the future this should be limited to only what
|
||||
# stack requires)
|
||||
echo "stack ALL=(ALL) NOPASSWD: ALL" >> $STAGING_DIR/etc/sudoers
|
||||
|
||||
# Gracefully cp only if source file/dir exists
|
||||
function cp_it {
|
||||
if [ -e $1 ] || [ -d $1 ]; then
|
||||
|
|
|
@ -240,6 +240,11 @@ if [ "$DO_SHUTDOWN" = "1" ]; then
|
|||
xe vm-shutdown uuid=$uuid
|
||||
xe vm-destroy uuid=$uuid
|
||||
done
|
||||
|
||||
# Destroy orphaned vdis
|
||||
for uuid in `xe vdi-list | grep -1 Glance | grep uuid | sed "s/.*\: //g"`; do
|
||||
xe vdi-destroy uuid=$uuid
|
||||
done
|
||||
fi
|
||||
|
||||
# Path to head xva. By default keep overwriting the same one to save space
|
||||
|
|
Loading…
Reference in a new issue