summaryrefslogtreecommitdiffstats
path: root/jjb/daisy4nfv/daisy4nfv-build.sh
diff options
context:
space:
mode:
authorzeyu zhu <zhu.zeyu@zte.com.cn>2016-11-11 15:37:43 +0800
committerzeyu zhu <zhu.zeyu@zte.com.cn>2016-11-11 15:38:01 +0800
commitc86717276af969766d3a0ad5fbe12d61466da42b (patch)
treed49292644a8691361b06506b56675dce97b7c7ca /jjb/daisy4nfv/daisy4nfv-build.sh
parentf901144368a524e617da0558ec32bd1f5f1789c2 (diff)
Add merge job to Daisy4nfv CI
Change-Id: I42e828663af780ab596477741d1d34c985c86197 Signed-off-by: zeyu zhu <zhu.zeyu@zte.com.cn>
Diffstat (limited to 'jjb/daisy4nfv/daisy4nfv-build.sh')
-rwxr-xr-xjjb/daisy4nfv/daisy4nfv-build.sh22
1 files changed, 21 insertions, 1 deletions
diff --git a/jjb/daisy4nfv/daisy4nfv-build.sh b/jjb/daisy4nfv/daisy4nfv-build.sh
index ec11db587..eb29fed72 100755
--- a/jjb/daisy4nfv/daisy4nfv-build.sh
+++ b/jjb/daisy4nfv/daisy4nfv-build.sh
@@ -4,11 +4,31 @@ echo "--------------------------------------------------------"
echo "This is diasy4nfv build job!"
echo "--------------------------------------------------------"
+# set OPNFV_ARTIFACT_VERSION
+if [[ "$JOB_NAME" =~ "merge" ]]; then
+ echo "Building Daisy4nfv ISO for a merged change"
+ export OPNFV_ARTIFACT_VERSION="gerrit-$GERRIT_CHANGE_NUMBER"
+else
+ export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
+fi
+
# build output directory
OUTPUT_DIR=$WORKSPACE/build_output
mkdir -p $OUTPUT_DIR
# start the build
cd $WORKSPACE
-./ci/build.sh $OUTPUT_DIR
+./ci/build.sh $OUTPUT_DIR $OPNFV_ARTIFACT_VERSION
+
+# save information regarding artifact into file
+(
+ echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
+ echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
+ echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
+ echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.bin"
+ echo "OPNFV_BUILD_URL=$BUILD_URL"
+) > $WORKSPACE/opnfv.properties
+echo
+echo "--------------------------------------------------------"
+echo "Done!"