c9c730594194055b4fe47999a9d7d4639ce9b52e
[releng.git] / jjb / global / installer-report.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2017 ZTE Corporation and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 source $WORKSPACE/installer_track.sh
11
12 gen_content()
13 {
14     cat <<EOF
15 {
16     "installer": "$INSTALLER",
17     "version": "$INSTALLER_VERSION",
18     "pod_name": "$POD_NAME",
19     "job_name": "$JOB_NAME",
20     "build_id": "$BUILD_ID",
21     "scenario": "$SCENARIO",
22     "upstream_job_name": "$UPSTREAM_JOB_NAME",
23     "upstream_build_id":"$UPSTREAM_BUILD_ID",
24     "criteria": "$PROVISION_RESULT",
25     "start_date": "$TIMESTAMP_START",
26     "stop_date": "$TIMESTAMP_END",
27     "details":""
28 }
29 EOF
30 }
31
32 echo "Installer: $INSTALLER provision result: $PROVISION_RESULT"
33 echo $(gen_content)
34
35 set -o xtrace
36 curl -H "Content-Type: application/json" -X POST -v -d "$(gen_content)" $TESTAPI_URL/deployresults