summaryrefslogtreecommitdiff
path: root/jenkins_kernel_ci_bundle
diff options
context:
space:
mode:
authorDeepti B. Kalakeri <deepti.kalakeri@linaro.org>2011-09-08 12:08:03 +0000
committerDeepti B. Kalakeri <deepti.kalakeri@linaro.org>2011-09-08 12:08:03 +0000
commitbd708afdf8c97e3aeba5bf75fcefa4cc8e8a4bd0 (patch)
treee3e85e5fe812bae903025bd49c294d0a0d9c9b65 /jenkins_kernel_ci_bundle
parent4b9ad13de99e22d27098810ee88119b02dc7cb14 (diff)
Reorganising the env variables so that even if the build fails the required env variables are
available for the sending the build status to LAVA
Diffstat (limited to 'jenkins_kernel_ci_bundle')
-rwxr-xr-xjenkins_kernel_ci_bundle21
1 files changed, 11 insertions, 10 deletions
diff --git a/jenkins_kernel_ci_bundle b/jenkins_kernel_ci_bundle
index ec5a715..c7f765b 100755
--- a/jenkins_kernel_ci_bundle
+++ b/jenkins_kernel_ci_bundle
@@ -7,26 +7,21 @@ from datetime import datetime, timedelta
from linaro_dashboard_bundle.io import DocumentIO
build_status=os.getenv('BUILD_STATUS')
-test_id="kernel build for %s board" %(os.getenv('BOARD_TYPE', 'unknown'))
-hwpack_filename=os.getenv('HWPACK_NAME')
-build_time=int(os.getenv('EXECUTION_TIME_IN_SEC'))
-date_time=hwpack_filename.rsplit('_', 3)[1]
-date_time=((datetime.strptime(date_time, "%Y%m%d-%H%M")).strftime("%Y-%m-%dT%H:%M:%SZ"))
gcc_cross_compiler_version = os.getenv('GCC_CROSS_COMPILER', 'unknown')
gcc_version = os.getenv('GCC_VERSION', 'unknown')
commit_time=os.getenv("COMMIT_TIME")
commit_time=commit_time.rsplit(' ', 1)[0]
commit_time=((datetime.strptime(commit_time, "%a, %d %b %Y %H:%M:%S")).strftime("%Y-%m-%dT%H:%M:%SZ"))
+
bundle = {
"format": "Dashboard Bundle Format 1.2",
"test_runs": [
{
- "test_id": test_id,
+ "test_id": "kernel-ci",
"test_results": [ {
- "test_case_id": os.getenv("KERNEL_NAME", 'unknown'),
- "result": build_status,
- "timestamp": date_time
+ "test_case_id": "build-status",
+ "result": build_status
},],
"attributes": {
"kernel.config": os.getenv('KERNEL_CONFIG', 'unknown'),
@@ -58,8 +53,14 @@ def GetInHMS(seconds):
d = timedelta(seconds=seconds)
return "%02dd %02ds %02dus" % (d.days, d.seconds, d.microseconds)
+if build_status != 'fail':
+ build_time=int(os.getenv('EXECUTION_TIME_IN_SEC'))
+ hwpack_filename=os.getenv('HWPACK_NAME')
+ timestamp=hwpack_filename.rsplit('_', 3)[1]
+ timestamp=((datetime.strptime(timestamp, "%Y%m%d-%H%M")).strftime("%Y-%m-%dT%H:%M:%SZ"))
+ bundle['test_runs'][0]['test_results'][0]['timestamp']=timestamp
+ bundle['test_runs'][0]['test_results'][0]['duration']=GetInHMS(build_time)
-bundle['test_runs'][0]['test_results'][0]['duration']=GetInHMS(build_time)
bundle['test_runs'][0]['software_context']['packages']=[{'version': gcc_version, 'name': 'gcc'},
{'version': gcc_cross_compiler_version,
'name': 'gcc-arm-linux-gnueabi'}]