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 ##############################################################################
18 # clone releng repository
19 echo "Cloning releng repository..."
20 [ -d releng ] && rm -rf releng
21 git clone https://gerrit.opnfv.org/gerrit/releng ./releng/ &> /dev/null
22 #this is where we import the siging key
23 if [ -f ./releng/utils/gpg_import_key.sh ]; then
24 source ./releng/utils/gpg_import_key.sh
28 upload_image_to_opnfv () {
32 if gpg2 --list-keys | grep "opnfv-helpdesk@rt.linuxfoundation.org"; then
33 echo "Signing Key avaliable"
37 if [[ -n "$SIGN_ARTIFACT" && "$SIGN_ARTIFACT" == "true" ]]; then
38 gpg2 -vvv --batch --yes --no-tty \
39 --default-key opnfv-helpdesk@rt.linuxfoundation.org \
40 --passphrase besteffort \
42 gsutil cp $image.sig gs://$GS_URL/upstream/$image.sig
43 echo "Image signature upload complete!"
46 sha512sum -b $image > $image.sha512sum
47 gsutil cp $image.sha512sum gs://$GS_URL/upstream/$image.sha512sum
49 echo "Uploading $INSTALLER_TYPE artifact. This could take some time..."
51 gsutil cp $image gs://$GS_URL/upstream/$image
53 -h "Cache-Control:private, max-age=0, no-transform" \
54 gs://$GS_URL/upstream/$image
56 # check if we uploaded the file successfully to see if things are fine
57 gsutil ls gs://$GS_URL/upstream/$image
58 if [[ $? -ne 0 ]]; then
59 echo "Problem while uploading artifact!"
66 echo "--------------------------------------------------------"
67 echo "This is diasy4nfv kolla image build job!"
68 echo "--------------------------------------------------------"
72 rm -rf docker_build_dir
73 mkdir -p docker_build_dir
75 # -j is for deciding which branch will be used when building,
77 sudo -E ./ci/kolla-build.sh -j $JOB_NAME -w $WORKSPACE/docker_build_dir
81 echo "Kolla build failed!"
85 echo "--------------------------------------------------------"
86 echo "Kolla build done!"
89 image=$(ls $WORKSPACE/docker_build_dir/kolla-build-output/kolla-image-*.tgz)
90 upload_image_to_opnfv $image
93 echo "--------------------------------------------------------"