2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
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
22 echo "Uploading the $INSTALLER_TYPE artifact. This could take some time..."
25 # source the opnfv.properties to get ARTIFACT_VERSION
26 source $WORKSPACE/opnfv.properties
28 # upload artifact and additional files to google storage
29 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso \
30 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
31 gsutil cp $WORKSPACE/opnfv.properties \
32 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
33 if [[ ! "$JOB_NAME" =~ (verify|merge) ]]; then
34 gsutil cp $WORKSPACE/opnfv.properties \
35 gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
36 elif [[ "$JOB_NAME" =~ "merge" ]]; then
37 echo "Uploaded Fuel ISO for a merged change"
41 -h "Content-Type:text/html" \
42 -h "Cache-Control:private, max-age=0, no-transform" \
43 gs://$GS_URL/latest.properties \
44 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > /dev/null 2>&1
47 -h "Cache-Control:private, max-age=0, no-transform" \
48 gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > /dev/null 2>&1
50 # disabled errexit due to gsutil setmeta complaints
51 # BadRequestException: 400 Invalid argument
52 # check if we uploaded the file successfully to see if things are fine
53 gsutil ls gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > /dev/null 2>&1
54 if [[ $? -ne 0 ]]; then
55 echo "Problem while uploading artifact!"
56 echo "Check log $WORKSPACE/gsutil.iso.log on the machine where this build is done."
62 echo "--------------------------------------------------------"
64 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
66 echo "--------------------------------------------------------"