aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/onap-lab-ci/jobs/get-result.sh
diff options
context:
space:
mode:
authorBrian Freeman <bf1936@att.com>2019-08-20 13:13:58 -0500
committerDaniel Rose <dr695h@att.com>2019-08-21 17:12:16 +0000
commit48d30546f897c3980186b886fa0635ca47bc500e (patch)
tree6d2ab89e6978ad38f09edab051c2c5c55ce40805 /deployment/onap-lab-ci/jobs/get-result.sh
parent7138060f1d84cf233a56e72403ca19113a553a95 (diff)
Ingest onap-lab-ci jjb's
Issue-ID: INT-1215 Change-Id: I448fb7a147daa26d760df6c83fef75aa69f05879 Signed-off-by: Brian Freeman <bf1936@att.com>
Diffstat (limited to 'deployment/onap-lab-ci/jobs/get-result.sh')
-rwxr-xr-xdeployment/onap-lab-ci/jobs/get-result.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/deployment/onap-lab-ci/jobs/get-result.sh b/deployment/onap-lab-ci/jobs/get-result.sh
new file mode 100755
index 000000000..7ec39be2f
--- /dev/null
+++ b/deployment/onap-lab-ci/jobs/get-result.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+JOB=$1
+BUILD=$2
+
+mkdir -p $JOB
+JSON=$JOB/$BUILD.json
+if [ ! -f $JSON ]; then
+ curl -s "http://localhost:8080/jenkins/job/$JOB/$BUILD/api/json" > $JSON
+fi
+
+POD_TO_DELETE=$(jq -r '.actions[] | select(._class == "hudson.model.ParametersAction") | .parameters[] | select(._class == "hudson.model.StringParameterValue") | .value' < $JSON)
+
+TIMESTAMP=$(jq '.timestamp' < $JSON)
+START_TIME=$(date -d @$(($TIMESTAMP/1000)) +%H:%M:%S)
+
+DURATION=$(jq '.duration' < $JSON)
+DURATION_TIME=$(date -ud @$(($DURATION/1000)) +%M:%S)
+
+RESULT=$(jq -r '.result' < $JSON)
+
+echo "|$POD_TO_DELETE|$START_TIME|$DURATION_TIME|$RESULT|[$BUILD|http://onapci.org/logs/$JOB/$BUILD/]|"