Add option for scenarios jobs promotion

Add support for promote repositories with scenario jobs
but don't enable it.

Change-Id: I9efb59f9d5d1aa81765c4b31630bb93b57944113
This commit is contained in:
Sagi Shnaidman 2017-01-26 20:23:37 +02:00
parent 5dfaddbe83
commit 4efcd5923b
3 changed files with 23 additions and 13 deletions

View File

@ -388,3 +388,21 @@ function subnodes_scp_deploy_env {
done
}
function can_promote {
# If we got this far and its a periodic job, declare success and upload build artifacts
# but only if we are testing no changes or a single change only in tripleo_ci
CHANGES=( ${ZUUL_CHANGES//^/ } )
NUM_CHANGES=${#CHANGES[@]}
OTHER_PROJECTS="no"
for change in ${CHANGES[@]-}; do
if [[ ! "$change" =~ 'openstack-infra/tripleo-ci' ]]; then
OTHER_PROJECTS="yes"
fi
done
if [[ $NUM_CHANGES -le 1 && $OTHER_PROJECTS == "no" ]]; then
return 0
else
return 1
fi
}

View File

@ -144,6 +144,9 @@ sudo update-ca-trust extract
sudo ip link add ci-dummy type dummy
$TRIPLEO_ROOT/tripleo-ci/scripts/deploy.sh
if [[ $CACHEUPLOAD == 1 && can_promote ]] ; then
UPLOAD_FOLDER=builds${STABLE_RELEASE:+-$STABLE_RELEASE}
curl http://$MIRRORSERVER/cgi-bin/upload.cgi -F "repohash=$TRUNKREPOUSED" -F "folder=$UPLOAD_FOLDER" -F "$JOB_NAME=SUCCESS"
fi
exit 0
echo 'Run completed.'

View File

@ -121,19 +121,8 @@ fi
cp -f $TE_DATAFILE ~/instackenv.json
$TRIPLEO_ROOT/tripleo-ci/scripts/deploy.sh
# If we got this far and its a periodic job, declare success and upload build artifacts
# but only if we are testing no changes or a single change only in tripleo_ci
CHANGES=( ${ZUUL_CHANGES//^/ } )
NUM_CHANGES=${#CHANGES[@]}
OTHER_PROJECTS="no"
for change in ${CHANGES[@]-}; do
if [[ ! "$change" =~ 'openstack-infra/tripleo-ci' ]]; then
OTHER_PROJECTS="yes"
fi
done
if [[ $CACHEUPLOAD == 1 && $NUM_CHANGES -le 1 && $OTHER_PROJECTS == "no" ]] ; then
if [[ $CACHEUPLOAD == 1 && can_promote ]] ; then
# Get the IPA and overcloud images for caching
tar -C ~ -cf - ironic-python-agent.initramfs ironic-python-agent.vmlinuz ironic-python-agent.kernel > ipa_images.tar
tar -C ~ -cf - overcloud-full.qcow2 overcloud-full.initrd overcloud-full.vmlinuz > overcloud-full.tar