Add devstack jobs to job builder.

Change-Id: I933ea00356809cf13018761cad7344bb6855b867
This commit is contained in:
James E. Blair 2012-06-20 11:28:07 -07:00
parent d0722ac5cc
commit 6d94c1dde9
3 changed files with 231 additions and 14 deletions

View File

@ -49,7 +49,7 @@ def register(registry):
class Triggers(object):
sequence = 50
def __init__(self, registry):
self.registry = registry
for f in dir(self):

View File

@ -17,28 +17,37 @@
import xml.etree.ElementTree as XML
class wrappers(object):
def __init__(self, data):
self.data = data
def register(registry):
mod = Wrappers()
registry.registerModule(mod)
def gen_xml(self, xml_parent):
publishers = XML.SubElement(xml_parent, 'buildWrappers')
if 'timeout' in self.data['main']:
self._timeout(publishers)
if 'timestamps' in self.data['main']:
self._timestamps(publishers)
class Wrappers(object):
sequence = 80
def _timeout(self, xml_parent):
def gen_xml(self, xml_parent, data):
wrappers = XML.SubElement(xml_parent, 'buildWrappers')
if 'timeout' in data['main']:
self._timeout(wrappers, data)
if 'ansicolor' in data['main']:
self._ansicolor(wrappers, data)
if 'timestamps' in data['main']:
self._timestamps(wrappers, data)
def _timeout(self, xml_parent, data):
twrapper = XML.SubElement(xml_parent, 'hudson.plugins.build__timeout.BuildTimeoutWrapper')
tminutes = XML.SubElement(twrapper, 'timeoutMinutes')
tminutes.text = str(self.data['main']['timeout'])
tminutes.text = str(data['main']['timeout'])
failbuild = XML.SubElement(twrapper, 'failBuild')
fail = self.data['main'].get('timeout_fail', False)
fail = data['main'].get('timeout_fail', False)
if fail:
failbuild.text = 'true'
else:
failbuild.text = 'false'
def _timestamps(self, xml_parent):
def _timestamps(self, xml_parent, data):
XML.SubElement(xml_parent, 'hudson.plugins.timestamper.TimestamperBuildWrapper')
def _ansicolor(self, xml_parent, data):
XML.SubElement(xml_parent, 'hudson.plugins.ansicolor.AnsiColorBuildWrapper')

View File

@ -19,3 +19,211 @@ scm:
assignednode:
node: 'precise'
---
main:
name: 'gate-integration-tests-devstack-vm'
review_site: 'review.openstack.org'
github_org: 'openstack-ci'
concurrent: true
timeout: 40
timeout_fail: true
timestamps: true
ansicolor: true
logrotate:
daysToKeep: 28
numToKeep: -1
artifactDaysToKeep: -1
artifactNumToKeep: -1
triggers:
- zuul
builders:
- trigger_builds:
- project: devstack-update-inprogress
predefined_parameters:
DEVSTACK_NODE_NAME=${NODE_NAME}
- shell: |
#!/bin/bash -xe
#
# This job also gates devstack-gate, but in case a previous run fails,
# we need to always make sure that we're starting with the latest copy
# from master, before we start applying changes to it. If a previous run
# leaves a bad copy of the gate script, we may get stuck.
#
if [[ ! -e devstack-gate ]]; then
git clone https://review.openstack.org/p/openstack-ci/devstack-gate
else
cd devstack-gate
git remote update
git reset --hard
git clean -x -f
git checkout master
git reset --hard remotes/origin/master
git clean -x -f
cd ..
fi
- shell: |
#!/bin/bash -xe
export PYTHONUNBUFFERED=true
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
post_build_actions:
- archive:
artifacts: logs/*
- trigger_parameterized_builds:
- project: devstack-update-complete
when: complete
predefined_parameters:
DEVSTACK_NODE_NAME=${NODE_NAME}
scm:
scm: 'false'
assignednode:
node: 'devstack-precise'
---
main:
name: 'gate-tempest-devstack-vm'
review_site: 'review.openstack.org'
github_org: 'openstack-ci'
concurrent: true
timeout: 90
timeout_fail: true
timestamps: true
ansicolor: true
logrotate:
daysToKeep: 28
numToKeep: -1
artifactDaysToKeep: -1
artifactNumToKeep: -1
triggers:
- zuul
builders:
- trigger_builds:
- project: devstack-update-inprogress
predefined_parameters:
DEVSTACK_NODE_NAME=${NODE_NAME}
- shell: |
#!/bin/bash -xe
#
# This job also gates devstack-gate, but in case a previous run fails,
# we need to always make sure that we're starting with the latest copy
# from master, before we start applying changes to it. If a previous run
# leaves a bad copy of the gate script, we may get stuck.
#
if [[ ! -e devstack-gate ]]; then
git clone https://review.openstack.org/p/openstack-ci/devstack-gate
else
cd devstack-gate
git remote update
git reset --hard
git clean -x -f
git checkout master
git reset --hard remotes/origin/master
git clean -x -f
cd ..
fi
- shell: |
#!/bin/bash -xe
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=1
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
post_build_actions:
- archive:
artifacts: logs/*
- junit:
results: '**/nosetests.xml'
- trigger_parameterized_builds:
- project: devstack-update-complete
when: complete
predefined_parameters:
DEVSTACK_NODE_NAME=${NODE_NAME}
scm:
scm: 'false'
assignednode:
node: 'devstack-precise'
---
# Called by devstack jobs to alert that they have started so that the
# jenkins slave they are running on can be disabled.
main:
name: 'devstack-update-inprogress'
review_site: 'review.openstack.org'
github_org: 'openstack-ci'
logrotate:
daysToKeep: 28
numToKeep: -1
artifactDaysToKeep: -1
artifactNumToKeep: -1
builders:
- shell: |
#!/bin/bash -xe
if [[ ! -e devstack-gate ]]; then
git clone https://review.openstack.org/p/openstack-ci/devstack-gate
else
cd devstack-gate
git remote update
git pull --ff-only origin
cd ..
fi
- shell: |
#!/bin/bash -xe
export PYTHONUNBUFFERED=true
$WORKSPACE/devstack-gate/devstack-vm-inprogress.py $DEVSTACK_NODE_NAME
scm:
scm: 'false'
assignednode:
node: 'master'
---
# Called by devstack jobs to alert that they have completed so that the
# jenkins slave may be deleted.
main:
name: 'devstack-update-complete'
review_site: 'review.openstack.org'
github_org: 'openstack-ci'
logrotate:
daysToKeep: 28
numToKeep: -1
artifactDaysToKeep: -1
artifactNumToKeep: -1
builders:
- shell: |
#!/bin/bash -xe
if [[ ! -e devstack-gate ]]; then
git clone https://review.openstack.org/p/openstack-ci/devstack-gate
else
cd devstack-gate
git remote update
git pull --ff-only origin
cd ..
fi
- shell: |
#!/bin/bash -xe
export PYTHONUNBUFFERED=true
$WORKSPACE/devstack-gate/devstack-vm-delete.py $DEVSTACK_NODE_NAME
scm:
scm: 'false'
assignednode:
node: 'master'