6 if [ -z "$ARTIFACT_TYPE" ]; then
7 echo "ERROR: ARTIFACT_TYPE not provided...exiting"
12 echo "Uploading the Apex ${ARTIFACT_TYPE} artifact. This could take some time..."
13 echo "--------------------------------------------------------"
16 # source the opnfv.properties to get ARTIFACT_VERSION
17 source $WORKSPACE/opnfv.properties
19 BUILD_DIRECTORY=${WORKSPACE}/.build
21 # clone releng repository
22 echo "Cloning releng repository..."
23 [ -d releng ] && rm -rf releng
24 git clone https://gerrit.opnfv.org/gerrit/releng $WORKSPACE/releng/ &> /dev/null
25 #this is where we import the siging key
26 if [ -f $WORKSPACE/releng/utils/gpg_import_key.sh ]; then
27 source $WORKSPACE/releng/utils/gpg_import_key.sh
31 for artifact in $RPM_LIST $SRPM_LIST; do
32 echo "Signing artifact: ${artifact}"
33 gpg2 -vvv --batch --yes --no-tty \
34 --default-key opnfv-helpdesk@rt.linuxfoundation.org \
35 --passphrase besteffort \
36 --detach-sig $artifact
37 gsutil cp "$artifact".sig gs://$GS_URL/$(basename "$artifact".sig)
38 echo "Upload complete for ${artifact} signature"
43 time gpg2 -vvv --batch --yes --no-tty \
44 --default-key opnfv-helpdesk@rt.linuxfoundation.org \
45 --passphrase besteffort \
46 --detach-sig $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso
48 gsutil cp $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso.sig gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso.sig
49 echo "ISO signature Upload Complete!"
53 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
54 echo "ISO Upload Complete!"
58 for artifact in $RPM_LIST $SRPM_LIST; do
59 echo "Uploading artifact: ${artifact}"
60 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log
61 echo "Upload complete for ${artifact}"
63 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log
64 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log
68 # Uploads snapshot artifact and updated properties file
69 echo "Uploading snapshot artifacts"
70 SNAP_TYPE=$(echo ${JOB_NAME} | sed -n 's/^apex-\(.\+\)-promote.*$/\1/p')
71 gsutil cp $WORKSPACE/apex-${SNAP_TYPE}-snap-`date +%Y-%m-%d`.tar.gz gs://$GS_URL/ > gsutil.iso.log
72 if [ "$SNAP_TYPE" == 'csit' ]; then
73 gsutil cp $WORKSPACE/snapshot.properties gs://$GS_URL/snapshot.properties > gsutil.latest.log
75 echo "Upload complete for Snapshot"
78 if gpg2 --list-keys | grep "opnfv-helpdesk@rt.linuxfoundation.org"; then
79 echo "Signing Key avaliable"
83 if [ "$ARTIFACT_TYPE" == 'snapshot' ]; then
85 elif [ "$ARTIFACT_TYPE" == 'iso' ]; then
86 if [[ -n "$SIGN_ARTIFACT" && "$SIGN_ARTIFACT" == "true" ]]; then
90 elif [ "$ARTIFACT_TYPE" == 'rpm' ]; then
91 RPM_INSTALL_PATH=$BUILD_DIRECTORY/noarch
92 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
93 VERSION_EXTENSION=$(echo $(basename $OPNFV_RPM_URL) | sed 's/opnfv-apex-//')
94 for pkg in common undercloud; do # removed onos for danube
95 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
97 SRPM_INSTALL_PATH=$BUILD_DIRECTORY
98 SRPM_LIST=$SRPM_INSTALL_PATH/$(basename $OPNFV_SRPM_URL)
99 VERSION_EXTENSION=$(echo $(basename $OPNFV_SRPM_URL) | sed 's/opnfv-apex-//')
100 for pkg in common undercloud; do # removed onos for danube
101 SRPM_LIST+=" ${SRPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
104 if [[ -n "$SIGN_ARTIFACT" && "$SIGN_ARTIFACT" == "true" ]]; then
109 echo "ERROR: Unknown artifact type ${ARTIFACT_TYPE} to upload...exiting"
114 echo "--------------------------------------------------------"
116 if [ "$ARTIFACT_TYPE" == 'iso' ]; then echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"; fi
117 if [ "$ARTIFACT_TYPE" == 'rpm' ]; then echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"; fi