Gentoo Archives: gentoo-commits

From: Magnus Granberg <zorry@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/config/, /
Date: Sat, 02 Jan 2021 16:03:11
Message-Id: 1609603387.78b01143652300f1eb98df5d17d6dd4edadd789a.zorry@gentoo
1 commit: 78b01143652300f1eb98df5d17d6dd4edadd789a
2 Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 2 16:03:07 2021 +0000
4 Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 2 16:03:07 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=78b01143
7
8 Add config option project['repository_basedir']
9
10 Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>
11
12 buildbot_gentoo_ci/config/config.py | 17 +++++++++++------
13 gentooci.cfg | 3 +++
14 2 files changed, 14 insertions(+), 6 deletions(-)
15
16 diff --git a/buildbot_gentoo_ci/config/config.py b/buildbot_gentoo_ci/config/config.py
17 index 7ed59f1..e58e67c 100644
18 --- a/buildbot_gentoo_ci/config/config.py
19 +++ b/buildbot_gentoo_ci/config/config.py
20 @@ -15,7 +15,7 @@
21 # Copyright Buildbot Team Members
22 # Origins: buildbot.config.py
23 # Modifyed by Gentoo Authors.
24 -# Copyright 2020 Gentoo Authors
25 +# Copyright 2021 Gentoo Authors
26
27 import datetime
28 import inspect
29 @@ -49,6 +49,7 @@ from buildbot.config import ConfigErrors, error, loadConfigDict
30 _errors = None
31
32 DEFAULT_DB_URL = 'sqlite:///gentoo.sqlite'
33 +DEFAULT_REPOSITORY_BASEDIR = 'repository'
34
35 #Use GentooCiConfig.loadFromDict
36 @implementer(interfaces.IConfigLoader)
37 @@ -89,7 +90,8 @@ class GentooCiConfig(util.ComparableMixin):
38
39 _known_config_keys = set([
40 "db_url",
41 - "project"
42 + "project",
43 + "repository_basedir"
44 ])
45
46 compare_attrs = list(_known_config_keys)
47 @@ -137,9 +139,12 @@ class GentooCiConfig(util.ComparableMixin):
48 self.db = dict(db_url=self.getDbUrlFromConfig(config_dict))
49
50 def load_project(self, config_dict):
51 - if 'project' in config_dict:
52 - self.project = dict(
53 - project=config_dict['project']
54 - )
55 + self.project = {}
56 + if 'project' in config_dict:
57 + self.project['project'] = config_dict['project']
58 else:
59 error("project are not configured")
60 + if 'repository_basedir' in config_dict:
61 + self.project['repository_basedir'] = config_dict['repository_basedir']
62 + else:
63 + self.project['repository_basedir'] = DEFAULT_REPOSITORY_BASEDIR
64
65 diff --git a/gentooci.cfg b/gentooci.cfg
66 index 198f6e4..ff12a75 100644
67 --- a/gentooci.cfg
68 +++ b/gentooci.cfg
69 @@ -17,3 +17,6 @@ c['db_url'] = "mysql://buildbot:xxxx@192.168.1.x/gentooci?max_idle=300"
70
71 # This specifies what project buildbot uses for Gentoo Ci as default
72 c['project'] = "gosbsbase"
73 +
74 +# This specifies what the repository base dir is
75 +c['repository_basedir'] = "repository"