2 echo "--------------------------------------------------------"
3 echo "This is escalator upload job!"
4 echo "--------------------------------------------------------"
8 # check if we built something
9 if [ -f $WORKSPACE/.noupload ]; then
10 echo "Nothing new to upload. Exiting."
11 /bin/rm -f $WORKSPACE/.noupload
15 # source the opnfv.properties to get ARTIFACT_VERSION
16 source $WORKSPACE/opnfv.properties
19 # clone releng repository
20 echo "Cloning releng repository..."
21 [ -d releng ] && rm -rf releng
22 git clone https://gerrit.opnfv.org/gerrit/releng $WORKSPACE/releng/ &> /dev/null
23 #this is where we import the siging key
24 if [ -f $WORKSPACE/releng/utils/gpg_import_key.sh ]; then
25 source $WORKSPACE/releng/utils/gpg_import_key.sh
30 gpg2 -vvv --batch --yes --no-tty \
31 --default-key opnfv-helpdesk@rt.linuxfoundation.org \
32 --passphrase besteffort \
33 --detach-sig $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.tar.gz
35 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.tar.gz.sig gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.tar.gz.sig
36 echo "TAR signature Upload Complete!"
41 echo "Uploading $INSTALLER_TYPE artifact. This could take some time..."
45 # upload artifact and additional files to google storage
46 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.tar.gz \
47 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.tar.gz > gsutil.tar.log 2>&1
48 gsutil cp $WORKSPACE/opnfv.properties \
49 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
50 if [[ ! "$JOB_NAME" =~ (verify|merge) ]]; then
51 gsutil cp $WORKSPACE/opnfv.properties \
52 gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
53 elif [[ "$JOB_NAME" =~ "merge" ]]; then
54 echo "Uploaded Escalator TAR for a merged change"
58 -h "Content-Type:text/html" \
59 -h "Cache-Control:private, max-age=0, no-transform" \
60 gs://$GS_URL/latest.properties \
61 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > /dev/null 2>&1
64 -h "Cache-Control:private, max-age=0, no-transform" \
65 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.tar.gz > /dev/null 2>&1
67 # disabled errexit due to gsutil setmeta complaints
68 # BadRequestException: 400 Invalid argument
69 # check if we uploaded the file successfully to see if things are fine
70 gsutil ls gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.tar.gz > /dev/null 2>&1
71 if [[ $? -ne 0 ]]; then
72 echo "Problem while uploading artifact!"
73 echo "Check log $WORKSPACE/gsutil.bin.log on the machine where this build is done."
79 echo "--------------------------------------------------------"
81 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.tar.gz"
83 echo "--------------------------------------------------------"