[[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
# set OPNFV_ARTIFACT_VERSION
-export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
+if [[ $GERRIT_EVENT_TYPE = "change-merged" ]]; then
+ echo "Building Fuel ISO for a merged change"
+ OPNFV_ARTIFACT_VERSION=$(gerrit-$GERRIT_CHANGE_NUMBER)
+else
+ OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
+fi
# start the build
cd $WORKSPACE/$INSTALLER/ci
set -o nounset
set -o pipefail
-# get the latest.properties file in order to get info regarding latest artifact
-curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
+if [[ $GERRIT_EVENT_TYPE = "change-merged" ]]; then
+ # get the properties file for the Fuel ISO built for a merged change
+ curl -s -o $WORKSPACE/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties http://$GS_URL/latest.properties
+else
+ # get the latest.properties file in order to get info regarding latest artifact
+ curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
+fi
# check if we got the file
[[ -f latest.properties ]] || exit 1
# upload artifact and additional files to google storage
gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
-gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
+if [[ ! $GERRIT_EVENT_TYPE = "change-merged" ]]; then
+ gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
+else
+ echo "Uploaded Fuel ISO for a merged change"
+fi
echo
echo "--------------------------------------------------------"
builders:
- shell:
!include-raw ./fuel-build.sh
-# - shell:
-# !include-raw ./fuel-upload-artifact.sh
-# - shell:
-# !include-raw ./fuel-workspace-cleanup.sh
+ - shell:
+ !include-raw ./fuel-upload-artifact.sh
+ - shell:
+ !include-raw ./fuel-workspace-cleanup.sh
- job-template:
name: 'fuel-merge-virtual-deploy-{stream}'
dependency-jobs: 'fuel-merge-build-{stream}'
builders:
-# - shell:
-# !include-raw ./fuel-download-artifact.sh
+ - shell:
+ !include-raw ./fuel-download-artifact.sh
- shell:
!include-raw ./fuel-virtual-deploy.sh
-# - shell:
-# !include-raw ./fuel-workspace-cleanup.sh
+ - shell:
+ !include-raw ./fuel-workspace-cleanup.sh
- job-template:
name: 'fuel-daily-{stream}'