#!/usr/bin/env python
-#
-# This job require the Parameterized Build plugin, it's triggered
-# by http request get method to the job url, for example
-# http://my.host.com/job/JOB_NAME/buildWithParameters with data
-#
-#
+
+"""This job require the Parameterized Build plugin, it's triggered
+by http request get method to the job url, for example
+http://my.host.com/job/JOB_NAME/buildWithParameters with data
+"""
import sys
import os
from common.buildtrigger import trigger_next, trigger_info
def main(obs_event_fields):
+ """The main body"""
trigger_next(obs_event_fields['event_type'],
obs_event_fields)
if __name__ == '__main__':
- """ Jenkins task dispatcher, receive events from OBS jenkins notify plugin
- and create files to trigger downstream jobs """
+ # Jenkins task dispatcher, receive events from OBS jenkins notify plugin
+ # and create files to trigger downstream jobs
if len(sys.argv) == 1:
- project = os.getenv('project')
- obs_event_fields = trigger_info(os.getenv('para'))
- obs_event_type = os.getenv('event_type')
+ PROJECT = os.getenv('project')
+ OBS_EVENT_FIELDS = trigger_info(os.getenv('para'))
+ OBS_EVENT_TYPE = os.getenv('event_type')
else:
- project = ''
- obs_event_type = ''
- obs_event_fields = ''
+ PROJECT = ''
+ OBS_EVENT_TYPE = ''
+ OBS_EVENT_FIELDS = ''
- sys.exit(main(obs_event_fields))
+ sys.exit(main(OBS_EVENT_FIELDS))