diff options
author | Magnus Granberg <zorry@gentoo.org> | 2022-07-08 23:51:33 +0200 |
---|---|---|
committer | Magnus Granberg <zorry@gentoo.org> | 2022-07-08 23:51:33 +0200 |
commit | 2eaefa1a0df4c7153f04d4784bdc78f68faf29d4 (patch) | |
tree | 326905ef6a3e3e03727f42a2f5fb4bbf319d4b45 | |
parent | Change title_issue and title_phase (diff) | |
download | tinderbox-cluster-2eaefa1a0df4c7153f04d4784bdc78f68faf29d4.tar.gz tinderbox-cluster-2eaefa1a0df4c7153f04d4784bdc78f68faf29d4.tar.bz2 tinderbox-cluster-2eaefa1a0df4c7153f04d4784bdc78f68faf29d4.zip |
Add support for GitLabStatusPush
Signed-off-by: Magnus Granberg <zorry@gentoo.org>
-rw-r--r-- | buildbot_gentoo_ci/config/change_source.py | 11 | ||||
-rw-r--r-- | buildbot_gentoo_ci/config/reporters.py | 26 | ||||
-rw-r--r-- | buildbot_gentoo_ci/config/schedulers.py | 16 | ||||
-rw-r--r-- | buildbot_gentoo_ci/steps/update_db.py | 5 | ||||
-rw-r--r-- | master.cfg | 24 |
5 files changed, 62 insertions, 20 deletions
diff --git a/buildbot_gentoo_ci/config/change_source.py b/buildbot_gentoo_ci/config/change_source.py index 454ed4a..75bfe66 100644 --- a/buildbot_gentoo_ci/config/change_source.py +++ b/buildbot_gentoo_ci/config/change_source.py @@ -1,4 +1,4 @@ -# Copyright 2021 Gentoo Authors +# Copyright 2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 from buildbot.plugins import changes, util @@ -7,12 +7,15 @@ from buildbot.plugins import changes, util # Get the repositorys info from the gentoo-ci db def gentoo_change_source(cs=[]): cs.append(changes.GitPoller( - repourl='https://github.com/gentoo/gentoo.git', + #repourl='https://github.com/zorry/gentoo.git', + repourl='https://gitlab.gentoo.org/zorry/gentoo-ci.git', branches=True, workdir= 'repositorys' + '/gentoo.git/', - pollInterval=240, + pollInterval=300, pollRandomDelayMin=20, pollRandomDelayMax=60, - project='gentoo' + project='gentoo-ci' + #sshPrivateKey = util.Secret("gitlab_ssh_pub_gentoo-ci"), + #sshHostKey = util.Secret("gitlab_ssh_host_gentoo-ci") )) return cs diff --git a/buildbot_gentoo_ci/config/reporters.py b/buildbot_gentoo_ci/config/reporters.py index 1bfb70f..d37dd2a 100644 --- a/buildbot_gentoo_ci/config/reporters.py +++ b/buildbot_gentoo_ci/config/reporters.py @@ -1,8 +1,9 @@ -# Copyright 2021 Gentoo Authors +# Copyright 2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -#from buildbot import reporters as buildbot_reporters -from buildbot.reporters.generators.build import BuildStatusGenerator +from buildbot.plugins import util +from buildbot.reporters.gitlab import GitLabStatusPush +from buildbot.reporters.generators.build import BuildStatusGenerator, BuildStartEndStatusGenerator from buildbot.reporters.message import MessageFormatter from buildbot_gentoo_ci.reporters import irc @@ -39,7 +40,26 @@ irc_reporter = irc.IRCStatusPush("irc.libera.chat", "gci_test", generators=ircGenerators(), noticeOnChannel=True ) +#gitlab +def gitlabGenerators(): + builders = [ + #'run_build_request', + 'parse_build_log' + ] + return [ + BuildStartEndStatusGenerator( + builders=builders + ) + ] +gitlab_gentoo_org = GitLabStatusPush(token=util.Secret("gitlabToken"), + #context= util.Interpolate('Buildbot %(prop:buildername)s'), + baseURL='https://gitlab.gentoo.org', + generators=gitlabGenerators(), + #debug=True, + verbose=True + ) def gentoo_reporters(r=[]): r.append(irc_reporter) + r.append(gitlab_gentoo_org) return r diff --git a/buildbot_gentoo_ci/config/schedulers.py b/buildbot_gentoo_ci/config/schedulers.py index 8c08006..7c0aa6b 100644 --- a/buildbot_gentoo_ci/config/schedulers.py +++ b/buildbot_gentoo_ci/config/schedulers.py @@ -1,4 +1,4 @@ -# Copyright 2021 Gentoo Authors +# Copyright 2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 from buildbot.plugins import schedulers, util @@ -28,7 +28,11 @@ def getGitChanges(props): if k['repository'].endswith('.git'): for v in k['repository'].split('/'): if v.endswith('.git'): - change_data['repository'] = v[:-4] + # on gitlab we use gentoo-ci as fork of gentoo + if v[:-4] == 'gentoo-ci': + change_data['repository'] = 'gentoo' + else: + change_data['repository'] = v[:-4] change_data['author'] = k['author'] change_data['committer'] = k['committer'] change_data['comments'] = k['comments'] @@ -49,7 +53,7 @@ def gentoo_schedulers(): create_stage4 = schedulers.ForceScheduler( name="create_stage4", buttonName="Create stage4", - label="Create stage4 form", + label="My nice create stage4 form", builderNames=['run_build_stage4_request'], # A completely customized property list. The name of the # property is the name of the parameter @@ -57,6 +61,12 @@ def gentoo_schedulers(): util.StringParameter(name="project_uuid", label="Project uuid", default="e89c2c1a-46e0-4ded-81dd-c51afeb7fcfd", size=36), + util.StringParameter(name="worker", + label="New worker uuid", + default="a89c2c1a-46e0-4ded-81dd-c51afeb7fcfd", size=36), + util.StringParameter(name="type", + label="type of worker", + default="docker", size=10), ]) update_cpv_data = schedulers.Triggerable(name="update_cpv_data", builderNames=["update_cpv_data"]) diff --git a/buildbot_gentoo_ci/steps/update_db.py b/buildbot_gentoo_ci/steps/update_db.py index 0ed4be1..c3d6516 100644 --- a/buildbot_gentoo_ci/steps/update_db.py +++ b/buildbot_gentoo_ci/steps/update_db.py @@ -38,7 +38,10 @@ class GetDataGentooCiProject(BuildStep): if self.getProperty("repository").endswith('.git'): for v in self.getProperty("repository").split('/'): if v.endswith('.git'): - repository = v[:-4] + if v[:-4] == 'gentoo-ci': + repository = 'gentoo' + else: + repository = v[:-4] if repository: self.repository_data = yield self.gentooci.db.repositorys.getRepositoryByName(repository) if self.getProperty("change_data")['repository'] != self.repository_data['name']: @@ -1,6 +1,6 @@ # -*- python -*- # ex: set filetype=python: -from buildbot.plugins import util +from buildbot.plugins import util, secrets from buildbot_gentoo_ci.config import schedulers, workers, builders, service, change_source, reporters # This is a sample buildmaster config file. It must be installed as @@ -8,12 +8,14 @@ from buildbot_gentoo_ci.config import schedulers, workers, builders, service, ch #FIXME: Get workers from db or a file worker_data = [ - {'uuid' : 'uuid', 'password' : '', 'type' : 'local', 'enable' : True, }, - {'uuid' : 'uuid', 'password' : '', 'type' : 'local', 'enable' : True, }, - {'uuid' : 'uuid', 'password' : '', 'type' : 'local', 'enable' : True, }, - {'uuid' : 'uuid', 'password' : '', 'type' : 'local', 'enable' : True, }, - {'uuid' : 'uuid', 'password' : 'password', 'type' : 'default', 'enable' : True, }, - {'uuid' : 'uuid', 'password' : 'password', 'type' : 'default', 'enable' : True, }, + {'uuid' : 'updatedb_1', 'password' : '', 'type' : 'local', 'enable' : True, }, + {'uuid' : 'updatedb_2', 'password' : '', 'type' : 'local', 'enable' : True, }, + {'uuid' : 'updatedb_3', 'password' : '', 'type' : 'local', 'enable' : True, }, + {'uuid' : 'updatedb_4', 'password' : '', 'type' : 'local', 'enable' : True, }, + {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfa', 'password' : 'test', 'type' : 'docker', 'enable' : True, }, + {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfb', 'password' : 'test', 'type' : 'docker', 'enable' : True, }, + {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfd', 'password' : 'test', 'type' : 'docker', 'enable' : True, }, + {'uuid' : 'c89c2c1a-46e0-4ded-81dd-c51afeb7fcfa', 'password' : 'test', 'type' : 'node', 'enable' : True, }, ] # This is the dictionary that the buildmaster pays attention to. We also use @@ -22,6 +24,10 @@ c = BuildmasterConfig = {} c['buildbotNetUsageData'] = None +####### SECRETS + +c['secretsProviders'] = [secrets.SecretInAFile(dirname="/var/lib/buildmaster/gentoo-ci-cloud/secrets/")] + ####### WORKERS # The 'workers' list defines the set of recognized workers. Each element is @@ -81,7 +87,7 @@ c['titleURL'] = "https://gentoo-ci.gentoo.org" # the 'www' entry below, but with an externally-visible host name which the # buildbot cannot figure out without some help. -c['buildbotURL'] = "http://localhost:8010/" +c['buildbotURL'] = "http://90.231.13.235:8010/" # minimalistic config to activate new web UI c['www'] = dict(port=8010, plugins=dict(waterfall_view={}, console_view={}, grid_view={})) @@ -101,4 +107,4 @@ c['www']['ui_default_config'] = { # It's easy to start with sqlite, but it's recommended to switch to a dedicated # database, such as PostgreSQL or MySQL, for use in production environments. # http://docs.buildbot.net/current/manual/configuration/global.html#database-specification -c['db_url'] = "postgresql://buildbot:password@ip/buildbot" +c['db_url'] = "postgresql://buildbot:fooo@192.168.1.9/buildbot" |