diff options
author | 2022-08-10 23:46:50 +0200 | |
---|---|---|
committer | 2022-08-10 23:46:50 +0200 | |
commit | 26929ff836acfe559456bed9f400dd4879973d8b (patch) | |
tree | afc02f0982e16e8ba1100a5fbe43997b304297fd /buildbot_gentoo_ci | |
parent | Add haskell-updater for haskell packages (diff) | |
download | tinderbox-cluster-26929ff836acfe559456bed9f400dd4879973d8b.tar.gz tinderbox-cluster-26929ff836acfe559456bed9f400dd4879973d8b.tar.bz2 tinderbox-cluster-26929ff836acfe559456bed9f400dd4879973d8b.zip |
Use one scheduler for push and mr
Signed-off-by: Magnus Granberg <zorry@gentoo.org>
Diffstat (limited to 'buildbot_gentoo_ci')
-rw-r--r-- | buildbot_gentoo_ci/config/schedulers.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/buildbot_gentoo_ci/config/schedulers.py b/buildbot_gentoo_ci/config/schedulers.py index b769f00..60f1857 100644 --- a/buildbot_gentoo_ci/config/schedulers.py +++ b/buildbot_gentoo_ci/config/schedulers.py @@ -42,9 +42,17 @@ def getGitChanges(props): change_data['project'] = k['project'] return change_data -def mr_branch_fn(branch): - # if branch end with -mr or -pr - if branch[-3] == '-mr' or branch[-3] == '-pr': +def bb_branch_fn(branch): + # check branch + print(f"Branch: {branch}") + if branch.endswith('-mr') or branch.endswith('-pr') or branch == 'master': + return True + return False + +def bb_category_fn(category): + # check event + print(f"Category: {category}") + if category == 'push' or category == 'merge_request': return True return False @@ -56,16 +64,7 @@ def gentoo_schedulers(): change_data = getGitChanges ), builderNames = builderUpdateDbNames, - change_filter=util.ChangeFilter(branch='master', category='push'), - ) - scheduler_update_db_mr= schedulers.SingleBranchScheduler( - name='scheduler_update_db_mr', - treeStableTimer=0, - properties = dict( - change_data = getGitChanges - ), - builderNames = builderUpdateDbNames, - change_filter=util.ChangeFilter(branch_fn=mr_branch_fn, category='merge_request'), + change_filter=util.ChangeFilter(branch_fn=bb_branch_fn, category_fn=bb_category_fn), ) create_stage4 = schedulers.ForceScheduler( name="create_stage4", @@ -102,7 +101,6 @@ def gentoo_schedulers(): s = [] s.append(create_stage4) s.append(scheduler_update_db) - s.append(scheduler_update_db_mr) s.append(update_repo_check) s.append(update_cpv_data) s.append(update_v_data) |