Bug 775192 - Docs for how to setup a personal development master don't result in a working master. r=bhearsum
--- a/Makefile.setup
+++ b/Makefile.setup
@@ -11,18 +11,42 @@ MYSQL_CONFIG = $(HOME)/.$(MASTER_NAME)_u
VIRTUALENV_PYTHON = $(BASEDIR)/bin/python
PIP = $(BASEDIR)/bin/pip
BUILDBOT = $(BASEDIR)/bin/buildbot
USER = cltbld
HOME = /home/$(USER)
BUILDBOT_BRANCH = production-0.8
BUILDBOTCUSTOM_BRANCH = production-0.8
BUILDBOTCONFIGS_BRANCH = production
+TOOLS_BRANCH = default
INSTALL_BUILDBOT_SLAVE=
+# staging master setup
+ifdef USE_DEV_MASTER
+MASTERS_JSON = dev-master_config.json
+HTTP_PORT = $(error HTTP_PORT must be defined)
+PB_PORT = $(error PB_PORT must be defined)
+SSH_PORT = $(error SSH_PORT must be defined)
+ROLE = $(error ROLE must be defined)
+
+GENERATE_MASTERS_JSON_CMD = \
+ sed -e 's,@BASEDIR@,$(BASEDIR),g' \
+ -e 's,@HTTP_PORT@,$(HTTP_PORT),g' \
+ -e 's,@PB_PORT@,$(PB_PORT),g' \
+ -e 's,@SSH_PORT@,$(SSH_PORT),g' \
+ -e 's,@MASTER_NAME@,$(MASTER_NAME),g' \
+ -e 's,@ROLE@,$(ROLE),g' \
+ -e 's,@ROLE@,$(ROLE),g' \
+ -e 's,@BUILDBOTCUSTOM_BRANCH@,$(BUILDBOTCUSTOM_BRANCH),g' \
+ -e 's,@BUILDBOTCONFIGS_BRANCH@,$(BUILDBOTCONFIGS_BRANCH),g' \
+ -e 's,@TOOLS_BRANCH@,$(TOOLS_BRANCH),g' \
+ -e 's,@BUILDBOT_BRANCH@,$(BUILDBOT_BRANCH),g' \
+ $(MASTERS_JSON).in > $(MASTERS_JSON)
+endif
+
ifdef MASTERS_JSON
SETUP_MASTER=setup-master.py -j $(MASTERS_JSON)
else
SETUP_MASTER=setup-master.py -8
endif
all: virtualenv deps install-buildbot master master-makefile other-files done
@@ -44,23 +68,27 @@ install-buildbot: SITE_PACKAGES = $(BASE
install-buildbot:
test -d $(BASEDIR)/buildbot || $(HG) clone -b $(BUILDBOT_BRANCH) $(HG_HOST)/$(HG_DIR)/buildbot $(BASEDIR)/buildbot
(cd $(BASEDIR)/buildbot/master; $(VIRTUALENV_PYTHON) setup.py develop install)
ifdef INSTALL_BUILDBOT_SLAVE
(cd $(BASEDIR)/buildbot/slave; $(VIRTUALENV_PYTHON) setup.py develop install)
endif
test -d $(BASEDIR)/buildbotcustom || $(HG) clone -b $(BUILDBOTCUSTOM_BRANCH) $(HG_HOST)/$(HG_DIR)/buildbotcustom $(BASEDIR)/buildbotcustom
test -d $(BASEDIR)/buildbot-configs || $(HG) clone -b $(BUILDBOTCONFIGS_BRANCH) $(HG_HOST)/$(HG_DIR)/buildbot-configs $(BASEDIR)/buildbot-configs
- test -d $(BASEDIR)/tools || $(HG) clone $(HG_HOST)/$(HG_DIR)/tools $(BASEDIR)/tools
+ test -d $(BASEDIR)/tools || $(HG) clone -b $(TOOLS_BRANCH) $(HG_HOST)/$(HG_DIR)/tools $(BASEDIR)/tools
# Get buildbotcustom and the build/tools library into PYTHONPATH
ln -sf $(BASEDIR)/buildbotcustom $(SITE_PACKAGES)/buildbotcustom
echo "$(BASEDIR)/tools/lib/python" > $(SITE_PACKAGES)/build-tools-lib.pth
master:
- (cd $(BASEDIR)/buildbot-configs; $(VIRTUALENV_PYTHON) $(SETUP_MASTER) -b $(BUILDBOT) $(BASEDIR)/master $(MASTER_NAME))
+ifdef GENERATE_MASTERS_JSON_CMD
+ cd $(BASEDIR)/buildbot-configs && $(GENERATE_MASTERS_JSON_CMD)
+endif
+ cd $(BASEDIR)/buildbot-configs && \
+ $(VIRTUALENV_PYTHON) $(SETUP_MASTER) -b $(BUILDBOT) $(BASEDIR)/master $(MASTER_NAME)
master-makefile:
ln -sf $(BASEDIR)/buildbot-configs/Makefile.master $(BASEDIR)/Makefile
other-files:
echo "[DEFAULT]" > $(MYSQL_CONFIG)
echo "database = mysql://buildbot:password@$(DATABASE)" >> $(MYSQL_CONFIG)
echo "master = http://this-master:port" >> $(MYSQL_CONFIG)
new file mode 100644
--- /dev/null
+++ b/dev-master_config.json.in
@@ -0,0 +1,28 @@
+[{
+ "basedir": "@BASEDIR@",
+ "bbconfigs_branch": "@BUILDBOTCONFIGS_BRANCH@",
+ "bbconfigs_dir": "@BASEDIR@/buildbot-configs",
+ "bbcustom_branch": "@BUILDBOTCUSTOM_BRANCH@",
+ "bbcustom_dir": "@BASEDIR@/buildbotcustom",
+ "buildbot_bin": "@BASEDIR@/bin/buildbot",
+ "buildbot_branch": "@BUILDBOT_BRANCH@",
+ "buildbot_python": "@BASEDIR@/bin/python",
+ "buildbot_setup": "@BASEDIR@/buildbot/master/setup.py",
+ "buildbot_version": "0.8.2",
+ "datacentre": "scl1",
+ "db_name": "dev-master01.build.scl1.mozilla.com:@BASEDIR@/master",
+ "enabled": true,
+ "environment": "staging",
+ "hostname": "dev-master01.build.scl1.mozilla.com",
+ "http_port": @HTTP_PORT@,
+ "master_dir": "@BASEDIR@/master",
+ "release_branches": ["mozilla-release", "mozilla-beta"],
+ "mobile_release_branches": ["mozilla-release", "mozilla-beta"],
+ "thunderbird_release_branches": ["comm-beta", "comm-release"],
+ "name": "@MASTER_NAME@",
+ "pb_port": @PB_PORT@,
+ "role": "@ROLE@",
+ "ssh_port": @SSH_PORT@,
+ "tools_branch": "@TOOLS_BRANCH@",
+ "tools_dir": "@BASEDIR@/tools"
+}]