summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhijiang Hu <hu.zhijiang@zte.com.cn>2017-11-13 02:34:32 -0500
committerZhijiang Hu <hu.zhijiang@zte.com.cn>2017-11-13 02:34:32 -0500
commit790e29d91e926e14862ad35a2fd0c791aba628d3 (patch)
tree9685bee76578d06febe42799b868cd307a8f8b54
parent58510b282114adfe69d7f64fc2f9e247856e4260 (diff)
Exit if kolla image build failed
Previously, image build failure was ignored since the failure is caused by images that we do not need. Then, we only build what we really need. So now, image build failure should not be ginored any more. This PS also do clean up task after failure occured, althrough this is not really necessary when running in a temporary VM. But it is helpful when running manually. Change-Id: Ica8771e80bc313795598e18dc0175177ccb6c11a Signed-off-by: Zhijiang Hu <hu.zhijiang@zte.com.cn>
-rwxr-xr-xci/kolla-build-vm.sh15
1 files changed, 5 insertions, 10 deletions
diff --git a/ci/kolla-build-vm.sh b/ci/kolla-build-vm.sh
index c7d94352..552af6fd 100755
--- a/ci/kolla-build-vm.sh
+++ b/ci/kolla-build-vm.sh
@@ -311,19 +311,15 @@ function start_build {
echo "Start to build Kolla image"
pushd $KOLLA_GIT_DIR/kolla
- # Some of the images may be failed to built out but is OK
- # so we use "|| true" here.
- # TODO: We can impl. some checks to see if the images that
- # we really care are built successfully.
echo "=============================OpenStack & ODL build from binary=============================="
REGISTRY_PARAM="--registry 127.0.0.1:5000 --push --tag $KOLLA_IMAGE_VERSION"
- tools/build.py $REGISTRY_PARAM || true;
+ tools/build.py $REGISTRY_PARAM;
echo "=============================DPDK build from source=============================="
REGISTRY_PARAM="--registry 127.0.0.1:5000 --push --tag $KOLLA_IMAGE_VERSION --template-override contrib/template-override/ovs-dpdk.j2 -t source dpdk"
- tools/build.py $REGISTRY_PARAM || true;
+ tools/build.py $REGISTRY_PARAM;
popd
}
@@ -339,7 +335,9 @@ error_trap()
fi
echo "Image build failed with $exitcode"
-
+ cleanup_kolla_image
+ cleanup_registry_server
+ cleanup_registry_data
exit $exitcode
}
@@ -361,6 +359,3 @@ start_registry_server
start_build
cleanup_kolla_image
pack_registry_data
-
-# TODO: Upload to OPNFV artifacts repo.
-