From c797c90b348411c9c0c4308b234d9cdd8803ec11 Mon Sep 17 00:00:00 2001 From: Gabriele Cerami Date: Mon, 16 Jan 2017 18:29:35 +0100 Subject: [PATCH] Promotion: restrict promotion acceptance rule Start image promotion process only if - we are launching a periodic job (no changes) - we are testing a maximum of 1 change - all the changes come from tripleo-ci Change-Id: If567cdf6fc0c36aed56e2927d66953e8e5ab6f7c --- toci_instack_ovb.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/toci_instack_ovb.sh b/toci_instack_ovb.sh index 7955b34ad..fc8be1e99 100755 --- a/toci_instack_ovb.sh +++ b/toci_instack_ovb.sh @@ -113,7 +113,18 @@ 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 -if [ $CACHEUPLOAD == 1 ] ; then +# 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 # 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