You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2018/02/16 18:18:28 UTC

[kibble-scanners] 02/02: add a timestamp for when we think the build finished.

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble-scanners.git

commit 103755f4cffeefa48b5224807e5c7f8f95c3fe4e
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Fri Feb 16 19:18:17 2018 +0100

    add a timestamp for when we think the build finished.
---
 src/plugins/scanners/jenkins.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/plugins/scanners/jenkins.py b/src/plugins/scanners/jenkins.py
index 9d7f222..d28a414 100644
--- a/src/plugins/scanners/jenkins.py
+++ b/src/plugins/scanners/jenkins.py
@@ -87,16 +87,23 @@ def scanJob(KibbleBit, source, job, creds):
                 status = 'failed'
             if build['result'] in ['ABORTED']:
                 status = 'aborted'
+            
+            # Calc when the build finished (jenkins doesn't show this)
+            if completed:
+                FIN = int(build['timestamp']/1000) + build['duration']
+            else:
+                FIN = 0
                 
             doc = {
                 # Build specific data
                 'id': buildhash,
+                'date': time.strftime("%Y/%m/%d %H:%M:%S", time.gmtime(FIN)),
                 'buildID': build['id'],
                 'completed': completed,
                 'duration': build['duration'],
                 'job': job['name'],
                 'status': status,
-                'started': build['timestamp'],
+                'started': int(build['timestamp']/1000),
                 'ci': 'jenkins',
                 'queuetime': queuetime,
                 

-- 
To stop receiving notification emails like this one, please contact
humbedooh@apache.org.