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 ##############################################################################
13 # check if we built something
14 if [ -f $WORKSPACE/.noupload ]; then
15 echo "Nothing new to upload. Exiting."
16 /bin/rm -f $WORKSPACE/.noupload
20 # source the opnfv.properties to get ARTIFACT_VERSION
21 source $WORKSPACE/opnfv.properties
24 # clone releng repository
25 echo "Cloning releng repository..."
26 [ -d releng ] && rm -rf releng
27 git clone https://gerrit.opnfv.org/gerrit/releng $WORKSPACE/releng/ &> /dev/null
28 #this is where we import the siging key
29 if [ -f $WORKSPACE/releng/utils/gpg_import_key.sh ]; then
30 source $WORKSPACE/releng/utils/gpg_import_key.sh
35 gpg2 -vvv --batch --yes --no-tty \
36 --default-key opnfv-helpdesk@rt.linuxfoundation.org \
37 --passphrase besteffort \
38 --detach-sig $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.bin
40 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.bin.sig gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.bin.sig
41 echo "BIN signature Upload Complete!"
46 echo "Uploading $INSTALLER_TYPE artifact. This could take some time..."
50 # upload artifact and additional files to google storage
51 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.bin \
52 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.bin > gsutil.bin.log 2>&1
53 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso \
54 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso >> gsutil.bin.log 2>&1
55 gsutil cp $WORKSPACE/opnfv.properties \
56 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
57 if [[ ! "$JOB_NAME" =~ (verify|merge) ]]; then
58 gsutil cp $WORKSPACE/opnfv.properties \
59 gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
60 elif [[ "$JOB_NAME" =~ "merge" ]]; then
61 echo "Uploaded Daisy4nfv artifacts for a merged change"
65 -h "Content-Type:text/html" \
66 -h "Cache-Control:private, max-age=0, no-transform" \
67 gs://$GS_URL/latest.properties \
68 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > /dev/null 2>&1
71 -h "Cache-Control:private, max-age=0, no-transform" \
72 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.bin > /dev/null 2>&1
74 # disabled errexit due to gsutil setmeta complaints
75 # BadRequestException: 400 Invalid argument
76 # check if we uploaded the file successfully to see if things are fine
77 gsutil ls gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.bin > /dev/null 2>&1
78 if [[ $? -ne 0 ]]; then
79 echo "Problem while uploading artifact!"
80 echo "Check log $WORKSPACE/gsutil.bin.log on the machine where this build is done."
86 echo "--------------------------------------------------------"
88 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.bin"
90 echo "--------------------------------------------------------"