d148258c0bde8b7dc1cacf48790ca13a5eaf4154
[releng.git] / jjb / apex / apex-upload-artifact.sh
1 #!/bin/bash
2 set -o errexit
3 set -o nounset
4 set -o pipefail
5
6 # log info to console
7 echo "Uploading the Apex artifact. This could take some time..."
8 echo "--------------------------------------------------------"
9 echo
10
11 # source the opnfv.properties to get ARTIFACT_VERSION
12 source $WORKSPACE/opnfv.properties
13
14 # upload artifact and additional files to google storage
15 gsutil cp $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
16 RPM_INSTALL_PATH=$BUILD_DIRECTORY/noarch
17 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
18 VERSION_EXTENSION=$(echo $(basename $OPNFV_RPM_URL) | sed 's/opnfv-apex-//')
19 for pkg in common undercloud opendaylight-sfc onos; do
20     RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
21 done
22 SRPM_INSTALL_PATH=$BUILD_DIRECTORY
23 SRPM_LIST=$SRPM_INSTALL_PATH/$(basename $OPNFV_SRPM_URL)
24 for pkg in common undercloud opendaylight-sfc onos; do
25     SRPM_LIST+=" ${SRPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
26 done
27 for artifact in $RPM_LIST $SRPM_LIST; do
28   gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
29 done
30 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
31 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
32
33 echo
34 echo "--------------------------------------------------------"
35 echo "Done!"
36 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
37 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"