From 6c0e846e12e780a2f46f3179ef9e6cdd3a413bbb Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Fri, 17 Jun 2016 03:47:31 +0200 Subject: testing/buildbot: Fix some stuff. * APKBUILD: Leverage default_prepare and use builddir (no _). * APKBUILD: Introduce some constants for better DRY-ness, reformat package() function, create there a workdir (otherwise buildbot won't start). * buildmaster.initd: Put openrc-run in shebang. Add create command, which is a wrapper around `buildbot create-master -r $BASEDIR`. It has not been truly tested, but at least it starts now if you perform following command before starting buildmaster: /etc/init.d/buildmaster create --- testing/buildbot/buildmaster.initd | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'testing/buildbot/buildmaster.initd') diff --git a/testing/buildbot/buildmaster.initd b/testing/buildbot/buildmaster.initd index 313365f3a67..05c1a10104e 100644 --- a/testing/buildbot/buildmaster.initd +++ b/testing/buildbot/buildmaster.initd @@ -1,8 +1,9 @@ -#!/sbin/runscript +#!/sbin/openrc-run # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 extra_started_commands="reload" +extra_stopped_commands="create" depend() { need net @@ -52,3 +53,17 @@ reload() { "${BASEDIR}"/buildmaster.pid eend $? } + +create() { + if [ -e "${BASEDIR}"/buildbot.tac -o -e "${BASEDIR}"/master.cfg ]; then + eerror "${BASEDIR} already contains buildbot.tac or master.cfg" + return 1 + fi + ebegin "Creating buildmaster in ${BASEDIR}" + start-stop-daemon -u "${USERNAME}" \ + --exec /usr/bin/buildbot \ + -- create-master -r "${BASEDIR}" + mv "${BASEDIR}"/master.cfg.sample "${BASEDIR}"/master.cfg + ewarn "Remember to customize exemplary master.cfg in ${BASEDIR}" + eend $? +} -- cgit v1.2.3