diff options
author | Will Holland <william.holland@codethink.co.uk> | 2015-09-17 08:55:13 +0100 |
---|---|---|
committer | Will Holland <william.holland@codethink.co.uk> | 2015-09-17 09:05:04 +0100 |
commit | cd63cde09de135e921b3a0d9c4c3b4e21d37d061 (patch) | |
tree | 46d296a82f127b89b45316d3e3c211c112d868c7 | |
parent | 41f670c0ffa221c8ae8153d3a223359ac37b34c6 (diff) | |
download | orchestration-cd63cde09de135e921b3a0d9c4c3b4e21d37d061.tar.gz |
Get categories from config file
So that bottlerock and master.cfg share categories
-rw-r--r-- | source/bottlerock.py | 11 | ||||
-rw-r--r-- | source/master.cfg | 41 | ||||
-rw-r--r-- | source/orch_config.py | 5 |
3 files changed, 29 insertions, 28 deletions
diff --git a/source/bottlerock.py b/source/bottlerock.py index ece788b..3a34e4b 100644 --- a/source/bottlerock.py +++ b/source/bottlerock.py @@ -4,17 +4,13 @@ # using plain HTTP from bottle import post, request, run, HTTPResponse +import imp +orch_config = imp.load_source('module.name', '../source/orch_config.py') LOGFILE = '../orch.log' DEFINITIONS = 'ssh://git@cu010-trove.codethink.com/baserock/baserock/definitions' TEST_REPO = 'ssh://git@cu010-trove.codethink.com/cu010-trove/br6/ciat-tester' -categories = [ - 'repo_update', - 'definitions_update', - 'build_complete', - 'deploy_complete'] - log_file = open(LOGFILE,'a') def log(msg): @@ -31,8 +27,7 @@ def sendchange(category,properties): ''' sendchange to buildbot with category and a dictionary of property names and their values ''' - global categories - assert category in categories + assert category in orch_config.categories import subprocess IP="127.0.0.1" bb_port=9999 diff --git a/source/master.cfg b/source/master.cfg index b6a0344..f9cb1af 100644 --- a/source/master.cfg +++ b/source/master.cfg @@ -38,11 +38,12 @@ c['change_source'].append(PBChangeSource( passwd='orchestration')) from buildbot.changes.filter import ChangeFilter +import imp +orch_config = imp.load_source('module.name', '../../source/orch_config.py') -definitions_filter = ChangeFilter(category='definitions_update') -lorry_filter = ChangeFilter(category='repo_update') -postbuild_filter = ChangeFilter(category='build_complete') -postdeploy_filter = ChangeFilter(category='deploy_complete') +categories = {} +for _c in orch_config.categories: + categories[_c] = ChangeFilter(category=_c) ####### SCHEDULERS @@ -54,25 +55,25 @@ from buildbot.schedulers.forcesched import ForceScheduler from buildbot.changes import filter c['schedulers'] = [] c['schedulers'].append(SingleBranchScheduler( - name="trigger_firehose_sched", - change_filter=lorry_filter, - treeStableTimer=None, - builderNames=["1. Integration"])) + name = "trigger_firehose_sched", + change_filter = categories['repo_update'], + treeStableTimer = None, + builderNames = ["1. Integration"])) c['schedulers'].append(SingleBranchScheduler( - name="trigger_builders_sched", - change_filter=definitions_filter, - treeStableTimer=None, - builderNames=["2. Build"])) + name = "trigger_builders_sched", + change_filter = categories['definitions_update'], + treeStableTimer = None, + builderNames = ["2. Build"])) c['schedulers'].append(SingleBranchScheduler( - name="trigger_deploy_sched", - change_filter=postbuild_filter, - treeStableTimer=None, - builderNames=["3. Deploy"])) + name = "trigger_deploy_sched", + change_filter = categories['build_complete'], + treeStableTimer = None, + builderNames = ["3. Deploy"])) c['schedulers'].append(SingleBranchScheduler( - name="trigger_testing_sched", - change_filter=postdeploy_filter, - treeStableTimer=None, - builderNames=["4. Test"])) + name = "trigger_testing_sched", + change_filter = categories['deploy_complete'], + treeStableTimer = None, + builderNames = ["4. Test"])) ####### BUILDERS diff --git a/source/orch_config.py b/source/orch_config.py new file mode 100644 index 0000000..73e7fab --- /dev/null +++ b/source/orch_config.py @@ -0,0 +1,5 @@ +categories = [ + 'repo_update', + 'definitions_update', + 'build_complete', + 'deploy_complete'] |