cf8fe21e7b
Using the wrong type of quotes in the bash code meant that the $ERRORS variable wasn't being resolved, resulting in a syntax error. Change-Id: I81c01f358338ce183dc74d4646b006fa30450473
96 lines
2.9 KiB
YAML
96 lines
2.9 KiB
YAML
- job:
|
|
name: 'gate-ironic-python-agent-buildimage-coreos'
|
|
node: ubuntu-trusty
|
|
|
|
builders:
|
|
- link-logs
|
|
- net-info
|
|
- gerrit-git-prep
|
|
- install-distro-packages
|
|
- shell: |
|
|
imagebuild/coreos/full_trusty_build.sh
|
|
|
|
publishers:
|
|
- console-log
|
|
|
|
- job-template:
|
|
name: 'ironic-python-agent-buildimage-{image-type}'
|
|
node: ubuntu-trusty
|
|
|
|
builders:
|
|
- link-logs
|
|
- net-info
|
|
- gerrit-git-prep
|
|
- install-distro-packages
|
|
- shell: |
|
|
#!/bin/bash -xe
|
|
BRANCH=$ZUUL_REFNAME
|
|
export BRANCH_PATH=`echo $BRANCH | tr / -`
|
|
|
|
mkdir UPLOAD_RAW
|
|
mkdir UPLOAD_TAR
|
|
|
|
JOBNAME={template-name}
|
|
TRANS_START_TIME=$(date +%s)
|
|
SUBUNIT_OUTPUT=testrepository.subunit
|
|
ERRORS=1
|
|
VENV=$(mktemp -d)
|
|
virtualenv $VENV
|
|
$VENV/bin/pip install -U os-testr
|
|
|
|
trap "finish" EXIT
|
|
|
|
function finish {{
|
|
if [[ "$ERRORS" -eq 1 ]]; then
|
|
$VENV/bin/generate-subunit $TRANS_START_TIME $SECONDS 'fail' $JOBNAME >> $SUBUNIT_OUTPUT
|
|
else
|
|
$VENV/bin/generate-subunit $TRANS_START_TIME $SECONDS 'success' $JOBNAME >> $SUBUNIT_OUTPUT
|
|
fi
|
|
gzip -9 $SUBUNIT_OUTPUT
|
|
if [ "$VENV" != "" ] ; then
|
|
rm -rf $VENV
|
|
VENV=""
|
|
fi
|
|
}}
|
|
|
|
type="{image-type}"
|
|
case $type in
|
|
tinyipa)
|
|
export BUILD_AND_INSTALL_TINYIPA=true
|
|
(cd imagebuild/tinyipa && make)
|
|
mv imagebuild/tinyipa/tinyipa*.tar.gz UPLOAD_TAR
|
|
mv imagebuild/tinyipa/tinyipa*.* UPLOAD_RAW
|
|
# NOTE(sambetts) Must clean up chroot directories before
|
|
# publisher rsync command tries and fails to read them
|
|
(cd imagebuild/tinyipa && make clean)
|
|
;;
|
|
coreos)
|
|
imagebuild/coreos/full_trusty_build.sh
|
|
mv imagebuild/coreos/UPLOAD/coreos_production_pxe* UPLOAD_RAW
|
|
mv ipa-coreos*.tar.gz UPLOAD_TAR
|
|
;;
|
|
esac
|
|
ERRORS=0
|
|
|
|
|
|
publishers:
|
|
- scp:
|
|
site: 'tarballs.openstack.org'
|
|
files:
|
|
- source: 'UPLOAD_RAW/*'
|
|
target: 'tarballs/ironic-python-agent/{image-type}/files/'
|
|
keep-hierarchy: false
|
|
copy-after-failure: false
|
|
- source: 'UPLOAD_TAR/*'
|
|
target: 'tarballs/ironic-python-agent/{image-type}/'
|
|
keep-hierarchy: false
|
|
copy-after-failure: false
|
|
- scp:
|
|
site: 'static.openstack.org'
|
|
files:
|
|
- target: 'logs/$LOG_PATH'
|
|
source: 'testrepository.subunit.gz'
|
|
keep-hierarchy: false
|
|
copy-after-failure: true
|
|
- console-log
|