diff --git a/Makefile b/Makefile index 50d87db..ae5be1c 100644 --- a/Makefile +++ b/Makefile @@ -58,8 +58,13 @@ $(BUILDDIR)/buildbot_installed: Makefile | $(BUILDDIR) touch $(BUILDDIR)/buildbot_installed # Create startup file once buildbot is installed and up-to-date +# Database setting is loaded from master/config.py +# create-master with initialize the database if it doesn't exist yet +# upgrade-master will upgrade it if it needs to be master/buildbot.tac: $(BUILDDIR)/buildbot_installed - buildbot create-master -rf master + DBLINE=$$(cd master && python3 -c 'import config; config.init("."); print(config.db["db_url"])') && \ + buildbot create-master -rf --db=$${DBLINE} master + buildbot upgrade-master master rm master/master.cfg.sample touch master/buildbot.tac diff --git a/README.md b/README.md index aa505d4..d0b773f 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ To setup the whole thing: - `. buildbot-master/bin/activate` - `git clone repo` - `cd dockerized-bb` + - `cp master/config.py.example master/config.py` and edit config.py to fit your needs - `make master` - `make workers` - `cp contrib/buildbot.service /etc/systemd/system/buildbot.service` and adapt paths and user diff --git a/master/config.py.example b/master/config.py.example index 7617eb1..985f0c9 100644 --- a/master/config.py.example +++ b/master/config.py.example @@ -5,6 +5,10 @@ def init(base_dir): buildbot_base_dir = os.path.expanduser(base_dir) buildbot_data_dir = os.path.normpath(os.path.join(buildbot_base_dir, "..", "buildbot-data")) +db = { + "db_url": "sqlite:///state.sqlite" +} + docker_socket = 'unix:///var/run/docker.sock' docker_workers_net = 'workers-net' diff --git a/master/master.cfg b/master/master.cfg index 9568246..72a2333 100644 --- a/master/master.cfg +++ b/master/master.cfg @@ -17,6 +17,10 @@ import workers, builds, platforms, ui c = BuildmasterConfig = {} +####### STORAGE + +c["db"] = config.db + ####### WORKERS ## The workers buildbots.