2 ##############################################################################
3 # Copyright (c) 2016 ZTE Coreporation and others.
4 # hu.zhijiang@zte.com.cn
5 # sun.jing22@zte.com.cn
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
17 upload_image_to_opnfv () {
20 sha512sum -b $image > $image.sha512sum
21 gsutil cp $image.sha512sum gs://$GS_URL/upstream/$image.sha512sum
23 echo "Uploading $INSTALLER_TYPE artifact. This could take some time..."
25 gsutil cp $image gs://$GS_URL/upstream/$image
27 -h "Cache-Control:private, max-age=0, no-transform" \
28 gs://$GS_URL/upstream/$image
30 # check if we uploaded the file successfully to see if things are fine
31 gsutil ls gs://$GS_URL/upstream/$image
32 if [[ $? -ne 0 ]]; then
33 echo "Problem while uploading artifact!"
40 echo "--------------------------------------------------------"
41 echo "This is diasy4nfv kolla image build job!"
42 echo "--------------------------------------------------------"
46 rm -rf docker_build_dir
47 mkdir -p docker_build_dir
49 # -j is for deciding which branch will be used when building,
51 sudo -E ./ci/kolla-build.sh -j $JOB_NAME -w $WORKSPACE/docker_build_dir
55 echo "Kolla build failed!"
59 echo "--------------------------------------------------------"
60 echo "Kolla build done!"
63 image=$(ls $WORKSPACE/docker_build_dir/kolla-build-output/kolla-image-*.tgz)
64 upload_image_to_opnfv $image
67 echo "--------------------------------------------------------"