summaryrefslogtreecommitdiffstats
path: root/jjb/global
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/global')
-rwxr-xr-xjjb/global/installer-report.sh49
-rw-r--r--jjb/global/releng-macros.yml43
-rw-r--r--jjb/global/slave-params.yml1
3 files changed, 72 insertions, 21 deletions
diff --git a/jjb/global/installer-report.sh b/jjb/global/installer-report.sh
index e2fcfd6f6..6cd83f1f1 100755
--- a/jjb/global/installer-report.sh
+++ b/jjb/global/installer-report.sh
@@ -8,18 +8,39 @@
##############################################################################
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": "$NODE_NAME",
+ "job_name": "$JOB_NAME",
+ "build_id": "$BUILD_ID",
+ "scenario": "$DEPLOY_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 || true
+
+# INFO
+# postbuildscript plugin shall always return the original job running status,
+# for the result returned from postbuildscript affects the CI pipeline.
+if [ "$PROVISION_RESULT" == "PASS" ]; then
+ exit 0
+else
+ exit 1
+fi
diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml
index a12a3c8a5..205802fab 100644
--- a/jjb/global/releng-macros.yml
+++ b/jjb/global/releng-macros.yml
@@ -40,6 +40,30 @@
default: 'refs/heads/{branch}'
description: "Default refspec needed for manually triggering."
+- parameter:
+ name: testapi-parameter
+ parameters:
+ - string:
+ name: TESTAPI_URL
+ default: 'http://testresults.opnfv.org/test/api/v1'
+ description: "Default TestAPI URL, currently using v1"
+ - string:
+ name: DEPLOY_SCENARIO
+ default: 'os-nosdn-nofeature-ha'
+ description: "OPNFV deployment scenario"
+ - string:
+ name: INSTALLER_VERSION
+ default: 'master'
+ description: "Installer release version"
+ - string:
+ name: UPSTREAM_JOB_NAME
+ default: ''
+ description: "Parent job name in Jenkins"
+ - string:
+ name: UPSTREAM_BUILD_ID
+ default: ''
+ description: "Parent job build_id in Jenkins"
+
- property:
name: logrotate-default
properties:
@@ -318,7 +342,9 @@
- shell: |
#!/bin/bash
if [[ -s violation.log ]]; then
- echo "Reporting lint result..."
+ cat violation.log
+ echo "Reporting lint result...."
+ set -x
msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
sed -i -e "1s#^#${msg}\n\n#" violation.log
cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
@@ -901,7 +927,7 @@
- email-ext:
<<: *email_ptl_defaults
recipients: >
- ManuelBuilmbuil@suse.com
+ mbuil@suse.com
- publisher:
name: 'email-snaps-ptl'
@@ -958,15 +984,18 @@
script-only-if-succeeded: true
builders:
- shell: |
- echo "export PROVISION_RESULT=SUCCEED" >> $WORKSPACE/installer_track.sh
- echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
+ echo "export PROVISION_RESULT=PASS" >> $WORKSPACE/installer_track.sh
+ echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
+ echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
- shell:
- !include-raw-escape: installer-report.sh
+ !include-raw: installer-report.sh
- postbuildscript:
+ script-only-if-succeeded: false
script-only-if-failed: true
builders:
- shell: |
echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
- echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
+ echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
+ echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
- shell:
- !include-raw-escape: installer-report.sh
+ !include-raw: installer-report.sh
diff --git a/jjb/global/slave-params.yml b/jjb/global/slave-params.yml
index 86b369bcd..6171a6abd 100644
--- a/jjb/global/slave-params.yml
+++ b/jjb/global/slave-params.yml
@@ -983,6 +983,7 @@
- 'doctor-fuel-x86_64'
- 'doctor-fuel-aarch64'
- 'doctor-joid-x86_64'
+ - 'doctor-daisy-x86_64'
- 'not-specified'
default-slaves:
- 'not-specified'