summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xjjb/global/installer-report.sh39
-rw-r--r--jjb/global/releng-macros.yml6
2 files changed, 30 insertions, 15 deletions
diff --git a/jjb/global/installer-report.sh b/jjb/global/installer-report.sh
index e2fcfd6f6..c9c730594 100755
--- a/jjb/global/installer-report.sh
+++ b/jjb/global/installer-report.sh
@@ -8,18 +8,29 @@
##############################################################################
source $WORKSPACE/installer_track.sh
-echo """
- INSTALLER: $INSTALLER
- INSTALLER_VERSION: $INSTALLER_VERSION
- JOB_NAME: $JOB_NAME
- BUILD_ID: $BUILD_ID
- SENARIO: $DEPLOY_SCENARIO
- UPSTREAM_JOB_NAME: $UPSTREAM_JOB_NAME:
- UPSTREAM_BUILD_ID: $UPSTREAM_BUILD_ID
- PROVISION_RESULT: $PROVISION_RESULT
- TIMESTAMP_START: $TIMESTAMP_START
- TIMESTAMP_END: `date '+%Y-%m-%d %H:%M:%S.%3N'`
- POD_NAME: $NODE_NAME
-"""
-# TODO call TestAPI to report installer provisoin result when API is ready
+gen_content()
+{
+ cat <<EOF
+{
+ "installer": "$INSTALLER",
+ "version": "$INSTALLER_VERSION",
+ "pod_name": "$POD_NAME",
+ "job_name": "$JOB_NAME",
+ "build_id": "$BUILD_ID",
+ "scenario": "$SCENARIO",
+ "upstream_job_name": "$UPSTREAM_JOB_NAME",
+ "upstream_build_id":"$UPSTREAM_BUILD_ID",
+ "criteria": "$PROVISION_RESULT",
+ "start_date": "$TIMESTAMP_START",
+ "stop_date": "$TIMESTAMP_END",
+ "details":""
+}
+EOF
+}
+
+echo "Installer: $INSTALLER provision result: $PROVISION_RESULT"
+echo $(gen_content)
+
+set -o xtrace
+curl -H "Content-Type: application/json" -X POST -v -d "$(gen_content)" $TESTAPI_URL/deployresults
diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml
index 3433cee5f..91f2848e1 100644
--- a/jjb/global/releng-macros.yml
+++ b/jjb/global/releng-macros.yml
@@ -39,6 +39,10 @@
name: GERRIT_REFSPEC
default: 'refs/heads/{branch}'
description: "Default refspec needed for manually triggering."
+ - string:
+ name: TESTAPI_URL
+ default: 'http://testresults.opnfv.org/test/api/v1'
+ description: "Default TestAPI URL, currently using v1"
- property:
name: logrotate-default
@@ -960,7 +964,7 @@
script-only-if-succeeded: true
builders:
- shell: |
- echo "export PROVISION_RESULT=SUCCEED" >> $WORKSPACE/installer_track.sh
+ echo "export PROVISION_RESULT=PASS" >> $WORKSPACE/installer_track.sh
echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
- shell:
!include-raw-escape: installer-report.sh