public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-util/buildbot-worker/, dev-util/buildbot-worker/files/
@ 2016-08-09 23:52 Brian Dolbec
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2016-08-09 23:52 UTC (permalink / raw
  To: gentoo-commits

commit:     1f6e4e956f45a71cc4ca09af253731d5f986b01e
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  9 21:50:15 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Aug  9 23:47:21 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f6e4e95

dev-util/buildbot-worker: New buildbot-0.9 worker (slave)

This new package replaces the dev-util/buildbot-slave package.
This new build slave is not comaptible with buildbot versions prior to 0.9*.

Package-Manager: portage-2.3.0

 dev-util/buildbot-worker/Manifest                  |  1 +
 .../buildbot-worker-0.9.0_rc1.ebuild               | 67 ++++++++++++++++++++++
 .../buildbot-worker/buildbot-worker-9999.ebuild    | 67 ++++++++++++++++++++++
 .../buildbot-worker/files/buildbot_worker.confd    |  9 +++
 .../buildbot-worker/files/buildbot_worker.initd    | 48 ++++++++++++++++
 .../buildbot-worker/files/buildbot_worker.service  | 12 ++++
 dev-util/buildbot-worker/metadata.xml              | 19 ++++++
 7 files changed, 223 insertions(+)

diff --git a/dev-util/buildbot-worker/Manifest b/dev-util/buildbot-worker/Manifest
new file mode 100644
index 0000000..f5d3c01
--- /dev/null
+++ b/dev-util/buildbot-worker/Manifest
@@ -0,0 +1 @@
+DIST buildbot-worker-0.9.0rc1.tar.gz 98041 SHA256 5fc9bc888aee3af5e144c51a6c11d8f5afe57e459644749c66b495e82fba7e7e SHA512 c9201649d8af74bc988032a69c20b220bf70b2fe7bba7eb27638408a34f2d82b90f6421a39f3a2af8cfbe8ea11429dc04faa1de635bff77fd5a9b13c9d78f167 WHIRLPOOL 6205a8bc018a65674e955fa6edeb9f32ec1f0dbc05bf50f649cab7271f506cfad61c8556a05c0d2185f364b9b9a493130bdea2e798cd96238f7b0797f6d12257

diff --git a/dev-util/buildbot-worker/buildbot-worker-0.9.0_rc1.ebuild b/dev-util/buildbot-worker/buildbot-worker-0.9.0_rc1.ebuild
new file mode 100644
index 0000000..b59c113
--- /dev/null
+++ b/dev-util/buildbot-worker/buildbot-worker-0.9.0_rc1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+EGIT_REPO_URI="https://github.com/buildbot/buildbot.git"
+
+[[ ${PV} == *9999 ]] && inherit git-r3
+inherit readme.gentoo user distutils-r1
+
+DESCRIPTION="BuildBot Slave Daemon"
+HOMEPAGE="http://trac.buildbot.net/ http://code.google.com/p/buildbot/ http://pypi.python.org/pypi/buildbot-slave"
+
+MY_PV="${PV/_p/p}"
+MY_V="0.9.0rc1"
+MY_P="${PN}-${MY_V}"
+[[ ${PV} == *9999 ]] || SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+if [[ ${PV} == *9999 ]]; then
+	KEYWORDS=""
+else
+	KEYWORDS="~amd64"
+fi
+IUSE="test"
+
+RDEPEND=">=dev-python/setuptools-21.2.1[${PYTHON_USEDEP}]
+	|| ( >=dev-python/twisted-core-8.0.0[${PYTHON_USEDEP}]
+		 <dev-python/twisted-16.3.0[${PYTHON_USEDEP}]
+	)
+	dev-python/future[${PYTHON_USEDEP}]
+	!<dev-util/buildbot-0.9.0_rc1"
+DEPEND="${RDEPEND}
+	test? ( dev-python/mock[${PYTHON_USEDEP}] )"
+
+S="${WORKDIR}/${MY_P}"
+[[ ${PV} == *9999 ]] && S=${S}/slave
+
+pkg_setup() {
+	enewuser buildbot
+
+	DOC_CONTENTS="The \"buildbot\" user and the \"buildbot_worker\" init script has been added
+		to support starting buildbot_worker through Gentoo's init system. To use this,
+		set up your build worker following the documentation, make sure the
+		resulting directories are owned by the \"buildbot\" user and point
+		\"${ROOT}etc/conf.d/buildbot_worker\" at the right location.  The scripts can
+		run as a different user if desired. If you need to run more than one
+		build worker, just copy the scripts."
+}
+
+python_install_all() {
+	distutils-r1_python_install_all
+
+	doman docs/buildbot-worker.1
+
+	newconfd "${FILESDIR}/buildbot_worker.confd" buildbot_worker
+	newinitd "${FILESDIR}/buildbot_worker.initd" buildbot_worker
+
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
+}

diff --git a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
new file mode 100644
index 0000000..1c363da
--- /dev/null
+++ b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+EGIT_REPO_URI="https://github.com/buildbot/buildbot.git"
+
+[[ ${PV} == *9999 ]] && inherit git-r3
+inherit readme.gentoo user distutils-r1
+
+DESCRIPTION="BuildBot Slave Daemon"
+HOMEPAGE="http://trac.buildbot.net/ http://code.google.com/p/buildbot/ http://pypi.python.org/pypi/buildbot-slave"
+
+MY_PV="${PV/_p/p}"
+MY_V="0.9.0rc1"
+MY_P="${PN}-${MY_V}"
+[[ ${PV} == *9999 ]] || SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+if [[ ${PV} == *9999 ]]; then
+	KEYWORDS=""
+else
+	KEYWORDS="~amd64"
+fi
+IUSE="test"
+
+RDEPEND=">=dev-python/setuptools-21.2.1[${PYTHON_USEDEP}]
+	|| ( >=dev-python/twisted-core-8.0.0[${PYTHON_USEDEP}]
+		 <dev-python/twisted-16.3.0[${PYTHON_USEDEP}]
+	)
+	dev-python/future[${PYTHON_USEDEP}]
+	!<dev-util/buildbot-0.9.0_rc1"
+DEPEND="${RDEPEND}
+	test? ( dev-python/mock[${PYTHON_USEDEP}] )"
+
+S="${WORKDIR}/${MY_P}"
+[[ ${PV} == *9999 ]] && S=${S}/slave
+
+pkg_setup() {
+	enewuser buildbot
+
+	DOC_CONTENTS="The \"buildbot\" user and the \"buildbot_worker\" init script has been added
+		to support starting buildbot_worker through Gentoo's init system. To use this,
+		set up your build worker following the documentation, make sure the
+		resulting directories are owned by the \"buildbot\" user and point
+		\"${ROOT}etc/conf.d/buildbot_worker\" at the right location.  The scripts can
+		run as a different user if desired. If you need to run more than one
+		build worker, just copy the scripts."
+}
+
+python_install_all() {
+	distutils-r1_python_install_all
+
+	doman docs/buildbot-worker.1
+
+	newconfd "${FILESDIR}/buildbot_worker.confd" buildslave
+	newinitd "${FILESDIR}/buildbot_worker.initd" buildslave
+
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
+}

diff --git a/dev-util/buildbot-worker/files/buildbot_worker.confd b/dev-util/buildbot-worker/files/buildbot_worker.confd
new file mode 100644
index 0000000..7e77999
--- /dev/null
+++ b/dev-util/buildbot-worker/files/buildbot_worker.confd
@@ -0,0 +1,9 @@
+# Path to the build slave's basedir.
+BASEDIR="/var/lib/buildbot_worker"
+
+# User account for the buildslave.
+# The basedir should be owned by this user.
+USERNAME="buildbot"
+
+# Extra options passed to twistd.
+TWISTD_OPTS=""

diff --git a/dev-util/buildbot-worker/files/buildbot_worker.initd b/dev-util/buildbot-worker/files/buildbot_worker.initd
new file mode 100644
index 0000000..5301ed5
--- /dev/null
+++ b/dev-util/buildbot-worker/files/buildbot_worker.initd
@@ -0,0 +1,48 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+	need net
+}
+
+checkconfig() {
+	if [ -z "${BASEDIR}" ]; then
+		eerror "BASEDIR not set"
+		return 1
+	fi
+	if [ -z "${USERNAME}" ]; then
+		eerror "USERNAME not set"
+		return 1
+	fi
+	if [ ! -d "${BASEDIR}" ]; then
+		eerror "${BASEDIR} is not a directory"
+		return 1
+	fi
+	if [ ! -e "${BASEDIR}/buildbot.tac" ]; then
+		eerror "${BASEDIR} does not contain buildbot.tac"
+		return 1
+	fi
+}
+
+start() {
+	checkconfig || return 1
+	ebegin "Starting buildslave in ${BASEDIR}"
+	# We set HOME here to make something valid show up in the env of child
+	# processes spawned by the buildslave.
+	start-stop-daemon --start -u "${USERNAME}" \
+		--pidfile "${BASEDIR}/buildbot_worker.pid" \
+		--env HOME="${BASEDIR}" \
+		--exec /usr/bin/twistd -- \
+		--no_save \
+		--logfile="${BASEDIR}/twistd.log" \
+		--pidfile="${BASEDIR}/buildbot_worker.pid" \
+		--python="${BASEDIR}/buildbot.tac"
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping buildslave in ${BASEDIR}"
+	start-stop-daemon --stop --pidfile "${BASEDIR}/buildbot_worker.pid"
+	eend $?
+}

diff --git a/dev-util/buildbot-worker/files/buildbot_worker.service b/dev-util/buildbot-worker/files/buildbot_worker.service
new file mode 100644
index 0000000..e75a2d5
--- /dev/null
+++ b/dev-util/buildbot-worker/files/buildbot_worker.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=buildbot worker (slave) instances
+After=local-fs.target network.target
+
+[Service]
+Type=forking
+User=buildbot
+ExecStart=/usr/bin/buildbot_worker start /var/lib/buildbot_worker
+ExecStop=/usr/bin/buildbot_worker stop /var/lib/buildbot_worker
+
+[Install]
+WantedBy=multi-user.target

diff --git a/dev-util/buildbot-worker/metadata.xml b/dev-util/buildbot-worker/metadata.xml
new file mode 100644
index 0000000..973ff7f
--- /dev/null
+++ b/dev-util/buildbot-worker/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>hwoarang@gentoo.org</email>
+		<name>Markos Chandras</name>
+	</maintainer>
+	<maintainer type="person">
+		<email>dolsen@gentoo.org</email>
+		<name>Brian Dolbec</name>
+	</maintainer>
+	<upstream>
+		<maintainer>
+			<email>devel@buildbot.net</email>
+			<name>Developers List</name>
+		</maintainer>
+		<remote-id type="pypi">buildbot-slave</remote-id>
+	</upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/buildbot-worker/, dev-util/buildbot-worker/files/
@ 2017-01-06  0:48 Brian Dolbec
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2017-01-06  0:48 UTC (permalink / raw
  To: gentoo-commits

commit:     1678cf142eb81dd59e5892f3ab8557c78b0670ee
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  5 07:36:34 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Jan  6 00:48:15 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1678cf14

dev-util/buildbot-worker: Version bump, update 9999

This version now enables full test suite operation.

Package-Manager: Portage-2.3.3_p7, Repoman-2.3.1

 dev-util/buildbot-worker/Manifest                  |  2 ++
 ...er-9999.ebuild => buildbot-worker-0.9.2.ebuild} | 39 +++++++++++++++++-----
 .../buildbot-worker/buildbot-worker-9999.ebuild    | 24 +++++++++----
 .../files/buildbot-worker-0.9.Addmissedtests.patch | 27 +++++++++++++++
 4 files changed, 77 insertions(+), 15 deletions(-)

diff --git a/dev-util/buildbot-worker/Manifest b/dev-util/buildbot-worker/Manifest
index 8ed5aca..4beea8b 100644
--- a/dev-util/buildbot-worker/Manifest
+++ b/dev-util/buildbot-worker/Manifest
@@ -1,2 +1,4 @@
 DIST buildbot-worker-0.9.0.post1.tar.gz 95780 SHA256 9da22fdf23462680a37d3995cde75410f204d3cb417491363e3f6561fc9011b9 SHA512 50eb98ad4f870f15b1cc34113db139b3b290bef377b4f66ac7c023590f277c102b8776e3a009f296209cf524377c10f60435b18f47cc39d6c27af04778d3296e WHIRLPOOL 1dd5d4274281fe4f582b5e7b83a99693c41282cb2a5262b8899319d3a1e95888417174b8db4ed9f8dcd52ee66785adac98f0d2ecc8abc158a661dfdfa6cd33da
 DIST buildbot-worker-0.9.1.tar.gz 65852 SHA256 1d8ec4fd51e7a3a7dd4de7c512b282c221951cbacc6b2eaf15a157f371a0e902 SHA512 cf5749c6fd67fb72cd7043392efb502608cd2d11374cd43af351904a1b4e82d790338e5f745b47465b5cbf9501d2454d983648a70246c6ae55603ba51261a0d0 WHIRLPOOL e576879f141688e3f79e3cf746491bcc106cb4851f14d4960b10be45b7b01c33c6850fb856d6f083d8510ff78f73016e11250e9ef8864e33bace1834c315dafc
+DIST buildbot-worker-0.9.2.tar.gz 66043 SHA256 3d05791ac0c556e3e4fe0ef78911ce47eab4fcbb0b5a51a436234ba49b9c236e SHA512 146c2f2b0c44f5c349459edbe61b448e88f9e42eb1c3b7769a0a07260533e4ad40d2d7bc3df2ebecd355d636834108debe8c2d165a9cdc6d849a537cf5743cc4 WHIRLPOOL f786c3a7ac486a2421877082da08a73079b7655ec0941a9509663983c03874bc8b5c12cb990628d0684db757d493528fab9ea3d99d09c22f2d2bbf606c69d0b5
+DIST buildbot_worker-9-tests.tar.xz 29512 SHA256 9966f1e368fae1ff05a4cdd801167b33fbad620acba79db21a5c28132dec61a3 SHA512 55aa3a5061ba0c9246e5029201a3565c6b20b198ccbf7ad3cad29599bdb8f883e8f33290f0f6fdb2e4a7c04f9132e32d762df8241cda8f689d407bb75d048122 WHIRLPOOL 9200d3676bf9fa56f36cc0bfc229250f6619512574696bde460ea0410462ac9fe030c5222145599ea1a792003c3ab0a8fc729c2294274e85665da47c81d03fb9

diff --git a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild b/dev-util/buildbot-worker/buildbot-worker-0.9.2.ebuild
similarity index 67%
copy from dev-util/buildbot-worker/buildbot-worker-9999.ebuild
copy to dev-util/buildbot-worker/buildbot-worker-0.9.2.ebuild
index 1c363da..ac08bf8 100644
--- a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
+++ b/dev-util/buildbot-worker/buildbot-worker-0.9.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -13,10 +13,12 @@ inherit readme.gentoo user distutils-r1
 DESCRIPTION="BuildBot Slave Daemon"
 HOMEPAGE="http://trac.buildbot.net/ http://code.google.com/p/buildbot/ http://pypi.python.org/pypi/buildbot-slave"
 
-MY_PV="${PV/_p/p}"
-MY_V="0.9.0rc1"
+MY_V="${PV/_p/p}"
 MY_P="${PN}-${MY_V}"
-[[ ${PV} == *9999 ]] || SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
+if [[ ${PV} != *9999 ]]; then
+	SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz
+		http://dev.gentoo.org/~dolsen/distfiles/buildbot_worker-9-tests.tar.xz"
+fi
 
 LICENSE="GPL-2"
 SLOT="0"
@@ -28,13 +30,18 @@ fi
 IUSE="test"
 
 RDEPEND=">=dev-python/setuptools-21.2.1[${PYTHON_USEDEP}]
-	|| ( >=dev-python/twisted-core-8.0.0[${PYTHON_USEDEP}]
-		 <dev-python/twisted-16.3.0[${PYTHON_USEDEP}]
+	|| ( >=dev-python/twisted-16.0.0[${PYTHON_USEDEP}]
+		>=dev-python/twisted-core-8.0.0[${PYTHON_USEDEP}]
 	)
 	dev-python/future[${PYTHON_USEDEP}]
-	!<dev-util/buildbot-0.9.0_rc1"
+	!<dev-util/buildbot-0.9.0_rc1
+"
 DEPEND="${RDEPEND}
-	test? ( dev-python/mock[${PYTHON_USEDEP}] )"
+	test? (
+		dev-python/mock[${PYTHON_USEDEP}]
+		dev-python/setuptools_trial[${PYTHON_USEDEP}]
+	)
+"
 
 S="${WORKDIR}/${MY_P}"
 [[ ${PV} == *9999 ]] && S=${S}/slave
@@ -51,6 +58,22 @@ pkg_setup() {
 		build worker, just copy the scripts."
 }
 
+src_unpack() {
+	unpack ${MY_P}.tar.gz
+	cd ${MY_P}
+	unpack buildbot_worker-9-tests.tar.xz
+}
+
+src_prepare() {
+	epatch "${FILESDIR}"/buildbot-worker-0.9.Addmissedtests.patch
+	}
+
+python_test() {
+	distutils_install_for_testing
+
+	esetup.py test || die "Tests failed under ${EPYTHON}"
+}
+
 python_install_all() {
 	distutils-r1_python_install_all
 

diff --git a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
index 1c363da..99a27e8 100644
--- a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
+++ b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -13,8 +13,7 @@ inherit readme.gentoo user distutils-r1
 DESCRIPTION="BuildBot Slave Daemon"
 HOMEPAGE="http://trac.buildbot.net/ http://code.google.com/p/buildbot/ http://pypi.python.org/pypi/buildbot-slave"
 
-MY_PV="${PV/_p/p}"
-MY_V="0.9.0rc1"
+MY_V="${PV/_p/p}"
 MY_P="${PN}-${MY_V}"
 [[ ${PV} == *9999 ]] || SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
 
@@ -28,13 +27,18 @@ fi
 IUSE="test"
 
 RDEPEND=">=dev-python/setuptools-21.2.1[${PYTHON_USEDEP}]
-	|| ( >=dev-python/twisted-core-8.0.0[${PYTHON_USEDEP}]
-		 <dev-python/twisted-16.3.0[${PYTHON_USEDEP}]
+	|| ( >=dev-python/twisted-16.0.0[${PYTHON_USEDEP}]
+		>=dev-python/twisted-core-8.0.0[${PYTHON_USEDEP}]
 	)
 	dev-python/future[${PYTHON_USEDEP}]
-	!<dev-util/buildbot-0.9.0_rc1"
+	!<dev-util/buildbot-0.9.0_rc1
+"
 DEPEND="${RDEPEND}
-	test? ( dev-python/mock[${PYTHON_USEDEP}] )"
+	test? (
+		dev-python/mock[${PYTHON_USEDEP}]
+		dev-python/setuptools_trial[${PYTHON_USEDEP}]
+	)
+"
 
 S="${WORKDIR}/${MY_P}"
 [[ ${PV} == *9999 ]] && S=${S}/slave
@@ -51,6 +55,12 @@ pkg_setup() {
 		build worker, just copy the scripts."
 }
 
+python_test() {
+	distutils_install_for_testing
+
+	esetup.py test || die "Tests failed under ${EPYTHON}"
+}
+
 python_install_all() {
 	distutils-r1_python_install_all
 

diff --git a/dev-util/buildbot-worker/files/buildbot-worker-0.9.Addmissedtests.patch b/dev-util/buildbot-worker/files/buildbot-worker-0.9.Addmissedtests.patch
new file mode 100644
index 00000000..2604dfb
--- /dev/null
+++ b/dev-util/buildbot-worker/files/buildbot-worker-0.9.Addmissedtests.patch
@@ -0,0 +1,27 @@
+From 017f427a7c7959c11160a41e5987669f022e42c4 Mon Sep 17 00:00:00 2001
+From: Brian Dolbec <dolsen@gentoo.org>
+Date: Wed, 4 Jan 2017 19:01:12 -0800
+Subject: [PATCH] worker/setup.py: Add missed tests
+
+---
+ worker/setup.py | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/worker/setup.py b/worker/setup.py
+index f053a6226..cf004adbd 100755
+--- a/worker/setup.py
++++ b/worker/setup.py
+@@ -87,6 +87,10 @@ setup_args = {
+         "buildbot_worker.commands",
+         "buildbot_worker.scripts",
+         "buildbot_worker.monkeypatches",
++        "buildbot_worker.test",
++        "buildbot_worker.test.fake",
++        "buildbot_worker.test.unit",
++        "buildbot_worker.test.util",
+     ],
+     # mention data_files, even if empty, so install_data is called and
+     # VERSION gets copied
+-- 
+2.11.0
+


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/buildbot-worker/, dev-util/buildbot-worker/files/
@ 2017-08-21 22:34 Brian Dolbec
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2017-08-21 22:34 UTC (permalink / raw
  To: gentoo-commits

commit:     9cddfbc9d6e5a26811229b84daead5c5d04b21ab
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 21 22:29:31 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Aug 21 22:34:00 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cddfbc9

dev-util/buildbot-worker: Make the init script multi-instance capable

Use the same method as the buildbot master init script for multiple instances
on the same host.
Add RUNTIME_PYTHON variable (optional) to the conf.d to specify the desired
python to run it from.

Package-Manager: Portage-2.3.6_p65, Repoman-2.3.2_p133

 .../buildbot-worker-0.9.10-r1.ebuild               | 122 +++++++++++++++++++++
 .../buildbot-worker/buildbot-worker-9999.ebuild    |  60 +++++++++-
 .../buildbot-worker/files/buildbot_worker.confd2   |  14 +++
 .../buildbot-worker/files/buildbot_worker.initd    |   2 +-
 .../buildbot-worker/files/buildbot_worker.initd2   |  57 ++++++++++
 5 files changed, 248 insertions(+), 7 deletions(-)

diff --git a/dev-util/buildbot-worker/buildbot-worker-0.9.10-r1.ebuild b/dev-util/buildbot-worker/buildbot-worker-0.9.10-r1.ebuild
new file mode 100644
index 00000000000..5b24f1fed3b
--- /dev/null
+++ b/dev-util/buildbot-worker/buildbot-worker-0.9.10-r1.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 python3_5 )
+
+EGIT_REPO_URI="https://github.com/buildbot/buildbot.git"
+
+[[ ${PV} == *9999 ]] && inherit git-r3
+inherit readme.gentoo user distutils-r1
+
+DESCRIPTION="BuildBot Worker (slave) Daemon"
+HOMEPAGE="https://buildbot.net/ https://github.com/buildbot/buildbot https://pypi.python.org/pypi/buildbot-worker"
+
+MY_PV="${PV/_p/.post}"
+MY_P="${PN}-${MY_PV}"
+[[ ${PV} == *9999 ]] || SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+if [[ ${PV} == *9999 ]]; then
+	KEYWORDS=""
+else
+	KEYWORDS="~amd64"
+fi
+IUSE="test"
+
+RDEPEND=">=dev-python/setuptools-21.2.1[${PYTHON_USEDEP}]
+	>=dev-python/twisted-17.5.0[${PYTHON_USEDEP}]
+	dev-python/future[${PYTHON_USEDEP}]
+	!<dev-util/buildbot-0.9.7
+"
+DEPEND="${RDEPEND}
+	test? (
+		dev-python/mock[${PYTHON_USEDEP}]
+		dev-python/setuptools_trial[${PYTHON_USEDEP}]
+	)
+"
+
+S="${WORKDIR}/${MY_P}"
+[[ ${PV} == *9999 ]] && S=${S}/slave
+
+pkg_setup() {
+	enewuser buildbot
+
+	DOC_CONTENTS="The \"buildbot\" user and the \"buildbot_worker\" init script has been added
+		to support starting buildbot_worker through Gentoo's init system. To use this,
+		execute \"emerge --config =${CATEGORY}/${PF}\" to create a new instance.
+		Set up your build worker following the documentation, make sure the
+		resulting directories are owned by the \"buildbot\" user and point
+		\"${ROOT}etc/conf.d/buildbot_worker.myinstance\" at the right location.
+		The scripts can	run as a different user if desired."
+}
+
+python_test() {
+	distutils_install_for_testing
+
+	esetup.py test || die "Tests failed under ${EPYTHON}"
+}
+
+python_install_all() {
+	distutils-r1_python_install_all
+
+	doman docs/buildbot-worker.1
+
+	newconfd "${FILESDIR}/buildbot_worker.confd2" buildbot_worker
+	newinitd "${FILESDIR}/buildbot_worker.initd2" buildbot_worker
+
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
+
+	if [[ -n ${REPLACING_VERSIONS} ]]; then
+		ewarn
+		ewarn "Starting with buildbot-worker-0.9.10-r1, more than one instance of a buildbot_worker"
+		ewarn "can be run simultaneously. Note that \"BASEDIR\" in the buildbot_worker configuration file"
+		ewarn "is now the common base directory for all instances. If you are migrating from an older"
+		ewarn "version, make sure that you copy the current contents of \"BASEDIR\" to a subdirectory."
+		ewarn "The name of the subdirectory corresponds to the name of the buildbot_worker instance."
+		ewarn "In order to start the service running OpenRC-based systems need to link to the init file:"
+		ewarn "    ln --symbolic --relative /etc/init.d/buildbot_worker /etc/init.d/buildbot_worker.myinstance"
+		ewarn "    rc-update add buildbot_worker.myinstance default"
+		ewarn "    /etc/init.d/buildbot_worker.myinstance start"
+		ewarn "Systems using systemd can do the following:"
+		ewarn "    systemctl enable buildbot_worker@myinstance.service"
+		ewarn "    systemctl enable buildbot_worker.target"
+		ewarn "    systemctl start buildbot_worker.target"
+	fi
+}
+
+pkg_config() {
+	local buildworker_path="/var/lib/buildbot_worker"
+	einfo "This will prepare a new buildbot_worker instance in ${buildworker_path}."
+	einfo "Press Control-C to abort."
+
+	einfo "Enter the name for the new instance: "
+	read instance_name
+	[[ -z "${instance_name}" ]] && die "Invalid instance name"
+
+	local instance_path="${buildworker_path}/${instance_name}"
+	if [[ -e "${instance_path}" ]]; then
+		eerror "The instance with the specified name already exists:"
+		eerror "${instance_path}"
+		die "Instance already exists"
+	fi
+
+	local buildbot="/usr/bin/buildbot"
+	if [[ ! -d "${buildworker_path}" ]]; then
+		mkdir --parents "${buildworker_path}" || die "Unable to create directory ${buildworker_path}"
+	fi
+	"${buildbot}" create-master "${instance_path}" &>/dev/null || die "Creating instance failed"
+	chown --recursive buildbot "${instance_path}" || die "Setting permissions for instance failed"
+	mv "${instance_path}/master.cfg.sample" "${instance_path}/master.cfg" \
+		|| die "Moving sample configuration failed"
+	ln --symbolic --relative "/etc/init.d/buildbot_worker" "/etc/init.d/buildbot_worker.${instance_name}" \
+		|| die "Unable to create link to init file"
+
+	einfo "Successfully created a buildbot_worker instance at ${instance_path}."
+	einfo "To change the default settings edit the buildbot.tac file in this directory."
+}

diff --git a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
index e756aeaa6cc..6c1b8bf74aa 100644
--- a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
+++ b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
@@ -45,11 +45,11 @@ pkg_setup() {
 
 	DOC_CONTENTS="The \"buildbot\" user and the \"buildbot_worker\" init script has been added
 		to support starting buildbot_worker through Gentoo's init system. To use this,
-		set up your build worker following the documentation, make sure the
+		execute \"emerge --config =${CATEGORY}/${PF}\" to create a new instance.
+		Set up your build worker following the documentation, make sure the
 		resulting directories are owned by the \"buildbot\" user and point
-		\"${ROOT}etc/conf.d/buildbot_worker\" at the right location.  The scripts can
-		run as a different user if desired. If you need to run more than one
-		build worker, just copy the scripts."
+		\"${ROOT}etc/conf.d/buildbot_worker.myinstance\" at the right location.
+		The scripts can	run as a different user if desired."
 }
 
 python_test() {
@@ -63,12 +63,60 @@ python_install_all() {
 
 	doman docs/buildbot-worker.1
 
-	newconfd "${FILESDIR}/buildbot_worker.confd" buildbot_worker
-	newinitd "${FILESDIR}/buildbot_worker.initd" buildbot_worker
+	newconfd "${FILESDIR}/buildbot_worker.confd2" buildbot_worker
+	newinitd "${FILESDIR}/buildbot_worker.initd2" buildbot_worker
 
 	readme.gentoo_create_doc
 }
 
 pkg_postinst() {
 	readme.gentoo_print_elog
+
+	if [[ -n ${REPLACING_VERSIONS} ]]; then
+		ewarn
+		ewarn "Starting with buildbot-worker-0.9.10-r1, more than one instance of a buildbot_worker"
+		ewarn "can be run simultaneously. Note that \"BASEDIR\" in the buildbot_worker configuration file"
+		ewarn "is now the common base directory for all instances. If you are migrating from an older"
+		ewarn "version, make sure that you copy the current contents of \"BASEDIR\" to a subdirectory."
+		ewarn "The name of the subdirectory corresponds to the name of the buildbot_worker instance."
+		ewarn "In order to start the service running OpenRC-based systems need to link to the init file:"
+		ewarn "    ln --symbolic --relative /etc/init.d/buildbot_worker /etc/init.d/buildbot_worker.myinstance"
+		ewarn "    rc-update add buildbot_worker.myinstance default"
+		ewarn "    /etc/init.d/buildbot_worker.myinstance start"
+		ewarn "Systems using systemd can do the following:"
+		ewarn "    systemctl enable buildbot_worker@myinstance.service"
+		ewarn "    systemctl enable buildbot_worker.target"
+		ewarn "    systemctl start buildbot_worker.target"
+	fi
+}
+
+pkg_config() {
+	local buildworker_path="/var/lib/buildbot_worker"
+	einfo "This will prepare a new buildbot_worker instance in ${buildworker_path}."
+	einfo "Press Control-C to abort."
+
+	einfo "Enter the name for the new instance: "
+	read instance_name
+	[[ -z "${instance_name}" ]] && die "Invalid instance name"
+
+	local instance_path="${buildworker_path}/${instance_name}"
+	if [[ -e "${instance_path}" ]]; then
+		eerror "The instance with the specified name already exists:"
+		eerror "${instance_path}"
+		die "Instance already exists"
+	fi
+
+	local buildbot="/usr/bin/buildbot"
+	if [[ ! -d "${buildworker_path}" ]]; then
+		mkdir --parents "${buildworker_path}" || die "Unable to create directory ${buildworker_path}"
+	fi
+	"${buildbot}" create-master "${instance_path}" &>/dev/null || die "Creating instance failed"
+	chown --recursive buildbot "${instance_path}" || die "Setting permissions for instance failed"
+	mv "${instance_path}/master.cfg.sample" "${instance_path}/master.cfg" \
+		|| die "Moving sample configuration failed"
+	ln --symbolic --relative "/etc/init.d/buildbot_worker" "/etc/init.d/buildbot_worker.${instance_name}" \
+		|| die "Unable to create link to init file"
+
+	einfo "Successfully created a buildbot_worker instance at ${instance_path}."
+	einfo "To change the default settings edit the buildbot.tac file in this directory."
 }

diff --git a/dev-util/buildbot-worker/files/buildbot_worker.confd2 b/dev-util/buildbot-worker/files/buildbot_worker.confd2
new file mode 100644
index 00000000000..3ae1d865fdb
--- /dev/null
+++ b/dev-util/buildbot-worker/files/buildbot_worker.confd2
@@ -0,0 +1,14 @@
+# Path to the build slave's basedir.
+BASEDIR="/var/lib/buildbot_worker"
+
+# User account for the buildslave.
+# The basedir should be owned by this user.
+USERNAME="buildbot"
+
+# Extra options passed to twistd.
+TWISTD_OPTS=""
+
+# Optional specifiv python version to run in 
+# (if not the system default version)
+# ie: RUNTIME_PYTHON="/usr/bin/python2.7"
+RUNTIME_PYTHON=""

diff --git a/dev-util/buildbot-worker/files/buildbot_worker.initd b/dev-util/buildbot-worker/files/buildbot_worker.initd
index 5301ed546ba..8b13460491e 100644
--- a/dev-util/buildbot-worker/files/buildbot_worker.initd
+++ b/dev-util/buildbot-worker/files/buildbot_worker.initd
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 depend() {

diff --git a/dev-util/buildbot-worker/files/buildbot_worker.initd2 b/dev-util/buildbot-worker/files/buildbot_worker.initd2
new file mode 100644
index 00000000000..453d207e5d8
--- /dev/null
+++ b/dev-util/buildbot-worker/files/buildbot_worker.initd2
@@ -0,0 +1,57 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+BUILDWORKER_NAME=${RC_SVCNAME:16}
+BUILDWORKER_PATH="${BASEDIR}/${BUILDWORKER_NAME}"
+depend() {
+	need net
+}
+
+checkconfig() {
+	if [ -z "${BUILDWORKER_NAME}" ]; then
+		eerror "Buildbot-worker name not defined. Please link buildbot_worker.foo to this file to start the buildbot_worker with the name \"foo\"."
+		return 1
+	fi
+	if [ -z "${BASEDIR}" ]; then
+		eerror "BASEDIR not set"
+		return 1
+	fi
+	if [ -z "${USERNAME}" ]; then
+		eerror "USERNAME not set"
+		return 1
+	fi
+	if [ ! -d "${BUILDWORKER_PATH}" ]; then
+		eerror "${BUILDWORKER_PATH} is not a directory"
+		return 1
+	fi
+	if [ ! -e "${BUILDWORKER_PATH}/buildbot.tac" ]; then
+		eerror "${BUILDWORKER_PATH} does not contain buildbot.tac"
+		return 1
+	fi
+	if [ ! -e "${RUNTIME_PYTHON}" ]; then
+		RUNTIME_PYTHON="/usr/bin/python"
+	fi
+}
+
+start() {
+	checkconfig || return 1
+	ebegin "Starting buildbot-worker in ${BUILDWORKER_PATH}"
+	# We set HOME here to make something valid show up in the env of child
+	# processes spawned by the buildbot-worker.
+	start-stop-daemon --start -u "${USERNAME}" \
+		--pidfile "${BUILDWORKER_PATH}/buildbot_worker.pid" \
+		--env HOME="${BUILDWORKER_PATH}" \
+		--exec "${RUNTIME_PYTHON}" -- /usr/bin/twistd \
+		--no_save \
+		--logfile="${BUILDWORKER_PATH}/twistd.log" \
+		--pidfile="${BUILDWORKER_PATH}/buildbot_worker.pid" \
+		--python="${BUILDWORKER_PATH}/buildbot.tac"
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping buildbot-worker in ${BUILDWORKER_PATH}"
+	start-stop-daemon --stop --pidfile "${BUILDWORKER_PATH}/buildbot_worker.pid"
+	eend $?
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/buildbot-worker/, dev-util/buildbot-worker/files/
@ 2018-06-27 15:24 Brian Dolbec
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2018-06-27 15:24 UTC (permalink / raw
  To: gentoo-commits

commit:     5069f910206258f09b56e3bd43f6c487d9b39b6d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 17 10:34:53 2018 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Jun 27 15:24:12 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5069f910

dev-util/buildbot-worker: Version bump

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 dev-util/buildbot-worker/Manifest                  |   1 +
 .../buildbot-worker/buildbot-worker-1.1.2.ebuild   | 133 +++++++++++++++++++++
 .../buildbot-worker/files/buildbot_worker.confd2   |   2 +-
 3 files changed, 135 insertions(+), 1 deletion(-)

diff --git a/dev-util/buildbot-worker/Manifest b/dev-util/buildbot-worker/Manifest
index 8444ffed398..bf6ffcf0ac6 100644
--- a/dev-util/buildbot-worker/Manifest
+++ b/dev-util/buildbot-worker/Manifest
@@ -2,3 +2,4 @@ DIST buildbot-worker-0.9.12.tar.gz 101655 BLAKE2B a73f98ec56bd3ad6d19ad0b9dfa015
 DIST buildbot-worker-0.9.13.tar.gz 102710 BLAKE2B ab60bc2607a706ecc760c2439655bca3f328d773fbb07e73c994f079356341a251ca23c573a71cce92dbf71ba62ceaa70210f8925fd4d1cdfac335b2a485ee9f SHA512 920f76d70c88a660b1d4c15683847a144b8dfaa01b91742ff2fedbe013ab030d3c5f07b6308f8bfb3f7bf3c2f805f7735d007e67257ca5233d2b585518f79e40
 DIST buildbot-worker-0.9.15.post1.tar.gz 100901 BLAKE2B 5e4744fcd69e2920e0ca9ba0b1aa77ea5f62ed4aecc9f00df17953dc813e1f8d61a859ab0aacc26f88f51d281574a8089b849fe063d55c8649c4a53b528d8ba8 SHA512 6ee23f1dd52672646f28978cec3fa9e29b64cae84f524bbcb6f2614a4a56e49e8363975b89cd3508e78c9779233a27403e46fc098be0808d6cfc1e6aa6b8499f
 DIST buildbot-worker-1.1.0.tar.gz 102142 BLAKE2B 144587edf2adc9d99837dc549b4d0696761f6cb3c959d4c133a5136606934ce03836cd1fcb019e7bb8ec473526c2ac07146c4820ef4d8b17ed9d843acd6c06b4 SHA512 77c46b3c9a16847eaf72de1dafa871a3242b66235c94ce8109f953db39aa4b74de2a03ca7ff06e91f8ea0751ed57e6ec1f39336912d56346f1bed171f597f6ed
+DIST buildbot-worker-1.1.2.tar.gz 103013 BLAKE2B b44593b71e61fee4037911759fa4f686aaabf5ef4be9efaecd539e88c5fc2ed2059d8dd8d6d1c4b3ba57d3563f79aaa404176529622003070c136803c90beb10 SHA512 3dd3da7e87d667307fca264d91af4671f76c3aad93a0512ae5777bb2e3972efe349968cf72fa17b99e45f2d7cec1ec16b1180c48d296e2702c9548bf858951a7

diff --git a/dev-util/buildbot-worker/buildbot-worker-1.1.2.ebuild b/dev-util/buildbot-worker/buildbot-worker-1.1.2.ebuild
new file mode 100644
index 00000000000..dea70dbdd5e
--- /dev/null
+++ b/dev-util/buildbot-worker/buildbot-worker-1.1.2.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+EGIT_REPO_URI="https://github.com/buildbot/buildbot.git"
+
+[[ ${PV} == *9999 ]] && inherit git-r3
+inherit readme.gentoo-r1 user distutils-r1
+
+DESCRIPTION="BuildBot Worker (slave) Daemon"
+HOMEPAGE="https://buildbot.net/ https://github.com/buildbot/buildbot https://pypi.org/project/buildbot-worker/"
+
+MY_V="${PV/_p/.post}"
+MY_P="${PN}-${MY_V}"
+[[ ${PV} == *9999 ]] || SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+if [[ ${PV} == *9999 ]]; then
+	KEYWORDS=""
+else
+	KEYWORDS="~amd64"
+fi
+IUSE="test"
+
+RDEPEND=">=dev-python/setuptools-21.2.1[${PYTHON_USEDEP}]
+	>=dev-python/twisted-17.9.0[${PYTHON_USEDEP}]
+	dev-python/future[${PYTHON_USEDEP}]
+	!<dev-util/buildbot-0.9.7
+"
+DEPEND="${RDEPEND}
+	test? (
+		dev-python/mock[${PYTHON_USEDEP}]
+		dev-python/setuptools_trial[${PYTHON_USEDEP}]
+	)
+"
+
+S="${WORKDIR}/${MY_P}"
+[[ ${PV} == *9999 ]] && S=${S}/worker
+
+pkg_setup() {
+	enewuser buildbot
+
+	DOC_CONTENTS="The \"buildbot\" user and the \"buildbot_worker\" init script has been added
+		to support starting buildbot_worker through Gentoo's init system. To use this,
+		execute \"emerge --config =${CATEGORY}/${PF}\" to create a new instance.
+		Set up your build worker following the documentation, make sure the
+		resulting directories are owned by the \"buildbot\" user and point
+		\"${ROOT}etc/conf.d/buildbot_worker.myinstance\" at the right location.
+		The scripts can	run as a different user if desired."
+}
+
+python_test() {
+	distutils_install_for_testing
+
+	esetup.py test || die "Tests failed under ${EPYTHON}"
+}
+
+python_install_all() {
+	distutils-r1_python_install_all
+
+	doman docs/buildbot-worker.1
+
+	newconfd "${FILESDIR}/buildbot_worker.confd2" buildbot_worker
+	newinitd "${FILESDIR}/buildbot_worker.initd2" buildbot_worker
+
+	dodir /var/lib/buildbot_worker
+	cp "${FILESDIR}/buildbot.tac.sample" "${D}/var/lib/buildbot_worker"|| die "Install failed!"
+
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
+
+	if [[ -n ${REPLACING_VERSIONS} ]]; then
+		ewarn
+		ewarn "Starting with buildbot-worker-0.9.10-r1, more than one instance of a buildbot_worker"
+		ewarn "can be run simultaneously. Note that \"BASEDIR\" in the buildbot_worker configuration file"
+		ewarn "is now the common base directory for all instances. If you are migrating from an older"
+		ewarn "version, make sure that you copy the current contents of \"BASEDIR\" to a subdirectory."
+		ewarn "The name of the subdirectory corresponds to the name of the buildbot_worker instance."
+		ewarn "In order to start the service running OpenRC-based systems need to link to the init file:"
+		ewarn "    ln --symbolic --relative /etc/init.d/buildbot_worker /etc/init.d/buildbot_worker.myinstance"
+		ewarn "    rc-update add buildbot_worker.myinstance default"
+		ewarn "    /etc/init.d/buildbot_worker.myinstance start"
+		ewarn "Systems using systemd can do the following:"
+		ewarn "    systemctl enable buildbot_worker@myinstance.service"
+		ewarn "    systemctl enable buildbot_worker.target"
+		ewarn "    systemctl start buildbot_worker.target"
+	fi
+}
+
+pkg_config() {
+	local buildworker_path="/var/lib/buildbot_worker"
+	local log_path="/var/log/buildbot_worker"
+
+	einfo "This will prepare a new buildbot_worker instance in ${buildworker_path}."
+	einfo "Press Control-C to abort."
+
+	einfo "Enter the name for the new instance: "
+	read instance_name
+	[[ -z "${instance_name}" ]] && die "Invalid instance name"
+
+	local instance_path="${buildworker_path}/${instance_name}"
+	local instance_log_path="${log_path}/${instance_name}"
+
+	if [[ -e "${instance_path}" ]]; then
+		eerror "The instance with the specified name already exists:"
+		eerror "${instance_path}"
+		die "Instance already exists"
+	fi
+
+	if [[ ! -d "${instance_path}" ]]; then
+		mkdir --parents "${instance_path}" || die "Unable to create directory ${buildworker_path}"
+	fi
+	chown --recursive buildbot "${instance_path}" || die "Setting permissions for instance failed"
+	cp "${buildworker_path}/buildbot.tac.sample" "${instance_path}/buildbot.tac" \
+		|| die "Moving sample configuration failed"
+	ln --symbolic --relative "/etc/init.d/buildbot_worker" "/etc/init.d/buildbot_worker.${instance_name}" \
+		|| die "Unable to create link to init file"
+
+	if [[ ! -d "${instance_log_path}" ]]; then
+		mkdir --parents "${instance_log_path}" || die "Unable to create directory ${instance_log_path}"
+	fi
+	ln --symbolic --relative "${instance_log_path}/twistd.log" "${instance_path}/twistd.log" \
+		|| die "Unable to create link to log file"
+
+	einfo "Successfully created a buildbot_worker instance at ${instance_path}."
+	einfo "To change the default settings edit the buildbot.tac file in this directory."
+}

diff --git a/dev-util/buildbot-worker/files/buildbot_worker.confd2 b/dev-util/buildbot-worker/files/buildbot_worker.confd2
index 3ae1d865fdb..f14e3210ca9 100644
--- a/dev-util/buildbot-worker/files/buildbot_worker.confd2
+++ b/dev-util/buildbot-worker/files/buildbot_worker.confd2
@@ -8,7 +8,7 @@ USERNAME="buildbot"
 # Extra options passed to twistd.
 TWISTD_OPTS=""
 
-# Optional specifiv python version to run in 
+# Optional specific python version to run in
 # (if not the system default version)
 # ie: RUNTIME_PYTHON="/usr/bin/python2.7"
 RUNTIME_PYTHON=""


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/buildbot-worker/, dev-util/buildbot-worker/files/
@ 2020-05-13 20:48 Brian Dolbec
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2020-05-13 20:48 UTC (permalink / raw
  To: gentoo-commits

commit:     dcb7a06231e1c51664c529b1aa651395908fb498
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed May 13 20:46:40 2020 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed May 13 20:46:40 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dcb7a062

dev-util/buildbot-worker: Set correct permissions in pkg_config

Update buildbot.tac.sample to match current master.cfg.sample settings.
This allows for the worker to connect to the hello-world sample bot properly
provided it is on the same host as the master.

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 dev-util/buildbot-worker/buildbot-worker-2.7.0.ebuild | 4 +++-
 dev-util/buildbot-worker/buildbot-worker-9999.ebuild  | 4 +++-
 dev-util/buildbot-worker/files/buildbot.tac.sample    | 6 +++---
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dev-util/buildbot-worker/buildbot-worker-2.7.0.ebuild b/dev-util/buildbot-worker/buildbot-worker-2.7.0.ebuild
index 4c141f7b354..be5258cd998 100644
--- a/dev-util/buildbot-worker/buildbot-worker-2.7.0.ebuild
+++ b/dev-util/buildbot-worker/buildbot-worker-2.7.0.ebuild
@@ -114,7 +114,7 @@ pkg_config() {
 	if [[ ! -d "${instance_path}" ]]; then
 		mkdir --parents "${instance_path}" || die "Unable to create directory ${buildworker_path}"
 	fi
-	chown --recursive buildbot "${instance_path}" || die "Setting permissions for instance failed"
+	chown --recursive buildbot:buildbot "${instance_path}" || die "Setting permissions for instance failed"
 	cp "${buildworker_path}/buildbot.tac.sample" "${instance_path}/buildbot.tac" \
 		|| die "Moving sample configuration failed"
 	ln --symbolic --relative "/etc/init.d/buildbot_worker" "/etc/init.d/buildbot_worker.${instance_name}" \
@@ -122,6 +122,8 @@ pkg_config() {
 
 	if [[ ! -d "${instance_log_path}" ]]; then
 		mkdir --parents "${instance_log_path}" || die "Unable to create directory ${instance_log_path}"
+		chown --recursive buildbot:buildbot "${instance_log_path}" \
+			|| die "Setting permissions for instance failed"
 	fi
 	ln --symbolic --relative "${instance_log_path}/twistd.log" "${instance_path}/twistd.log" \
 		|| die "Unable to create link to log file"

diff --git a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
index 4c141f7b354..be5258cd998 100644
--- a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
+++ b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
@@ -114,7 +114,7 @@ pkg_config() {
 	if [[ ! -d "${instance_path}" ]]; then
 		mkdir --parents "${instance_path}" || die "Unable to create directory ${buildworker_path}"
 	fi
-	chown --recursive buildbot "${instance_path}" || die "Setting permissions for instance failed"
+	chown --recursive buildbot:buildbot "${instance_path}" || die "Setting permissions for instance failed"
 	cp "${buildworker_path}/buildbot.tac.sample" "${instance_path}/buildbot.tac" \
 		|| die "Moving sample configuration failed"
 	ln --symbolic --relative "/etc/init.d/buildbot_worker" "/etc/init.d/buildbot_worker.${instance_name}" \
@@ -122,6 +122,8 @@ pkg_config() {
 
 	if [[ ! -d "${instance_log_path}" ]]; then
 		mkdir --parents "${instance_log_path}" || die "Unable to create directory ${instance_log_path}"
+		chown --recursive buildbot:buildbot "${instance_log_path}" \
+			|| die "Setting permissions for instance failed"
 	fi
 	ln --symbolic --relative "${instance_log_path}/twistd.log" "${instance_path}/twistd.log" \
 		|| die "Unable to create link to log file"

diff --git a/dev-util/buildbot-worker/files/buildbot.tac.sample b/dev-util/buildbot-worker/files/buildbot.tac.sample
index ee3d7ca3cef..19bd941911b 100644
--- a/dev-util/buildbot-worker/files/buildbot.tac.sample
+++ b/dev-util/buildbot-worker/files/buildbot.tac.sample
@@ -29,9 +29,9 @@ maxRotatedFiles = 10
 port = 9989
 
 # worker settings
-worker_name = 'worker-1'
-passwd = 'mypasswd'
-buildmaster_host = 'mybuildbot.foobar.org'
+worker_name = 'example-worker'
+passwd = 'pass'
+buildmaster_host = 'localhost'
 keepalive = 600
 umask = None
 maxdelay = 300


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/buildbot-worker/, dev-util/buildbot-worker/files/
@ 2022-05-30  0:11 Brian Dolbec
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2022-05-30  0:11 UTC (permalink / raw
  To: gentoo-commits

commit:     48ecd5008646b9d70b728146f12e232b47794385
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun May 29 23:36:52 2022 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon May 30 00:11:17 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48ecd500

dev-util/buildbot-worker: Bump to 3.5.0

Update deps in 9999
Fix bug 845300

Closes: https://bugs.gentoo.org/845300
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 dev-util/buildbot-worker/Manifest                           |  1 +
 ...dbot-worker-9999.ebuild => buildbot-worker-3.5.0.ebuild} | 13 ++++++++++---
 dev-util/buildbot-worker/buildbot-worker-9999.ebuild        |  3 +++
 dev-util/buildbot-worker/files/buildbot_worker.initd2       |  4 ++--
 4 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/dev-util/buildbot-worker/Manifest b/dev-util/buildbot-worker/Manifest
index 2143d4df82fc..8cdd489c081c 100644
--- a/dev-util/buildbot-worker/Manifest
+++ b/dev-util/buildbot-worker/Manifest
@@ -1 +1,2 @@
 DIST buildbot-worker-3.4.0.tar.gz 102910 BLAKE2B c38a806e8d0475a8c18176310f628b829fc359f013b315e82715e71071213fe4a0cdf38273ad7df39a66675f4ebc9fb1881fb990290f2bbedf4c8777ec93d4dc SHA512 411a2bf496622c2b9a3e0dea1ea8a71b347566010086c57ffc5d1114546cc5052af39a8ff7b10ffe6e7afdb6fc8ff73a9ffba23b96a76ff1cc0e3eff81cc59a7
+DIST buildbot-worker-3.5.0.tar.gz 111349 BLAKE2B 90d193fb89ac65ca03274e0ad5c7fde8fc478bb932ccc4240495437f79171d49f623f50731c7619336386b7d1d7df3f955e10bf006ad86b8dcf294d75c874774 SHA512 1df67b6332753f91179863cca76b0578e4f36954e0aa4eb9c28f98d6451d6972e247849fb9d4e20b753b5702d100406b306ce4982181510ad81de0d35a9828ed

diff --git a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild b/dev-util/buildbot-worker/buildbot-worker-3.5.0.ebuild
similarity index 92%
copy from dev-util/buildbot-worker/buildbot-worker-9999.ebuild
copy to dev-util/buildbot-worker/buildbot-worker-3.5.0.ebuild
index 18ee776e0e52..7bf98bc994af 100644
--- a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
+++ b/dev-util/buildbot-worker/buildbot-worker-3.5.0.ebuild
@@ -4,30 +4,37 @@
 EAPI=8
 
 PYTHON_COMPAT=( python3_{8..10} )
-EGIT_REPO_URI="https://github.com/buildbot/buildbot.git"
-inherit readme.gentoo-r1 git-r3 distutils-r1
+inherit readme.gentoo-r1 distutils-r1
+
+MY_V="${PV/_p/.post}"
+MY_P="${PN}-${MY_V}"
 
 DESCRIPTION="BuildBot Worker (slave) Daemon"
 HOMEPAGE="https://buildbot.net/
 	https://github.com/buildbot/buildbot
 	https://pypi.org/project/buildbot-worker/"
-S="${S}/worker"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
 
 LICENSE="GPL-2"
 SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~riscv ~amd64-linux ~x86-linux"
 IUSE="test"
 RESTRICT="!test? ( test )"
 
 RDEPEND="
 	acct-user/buildbot
+	>=dev-python/autobahn-0.16.0[${PYTHON_USEDEP}]
 	>=dev-python/twisted-17.9.0[${PYTHON_USEDEP}]
 	dev-python/future[${PYTHON_USEDEP}]
 	!<dev-util/buildbot-1.0.0
 "
 BDEPEND="
+	>=dev-python/msgpack-0.6.0[${PYTHON_USEDEP}]
 	test? (
 		${RDEPEND}
 		dev-python/mock[${PYTHON_USEDEP}]
+		dev-python/psutil[${PYTHON_USEDEP}]
 	)
 "
 

diff --git a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
index 18ee776e0e52..511a5ed0a21b 100644
--- a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
+++ b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
@@ -20,14 +20,17 @@ RESTRICT="!test? ( test )"
 
 RDEPEND="
 	acct-user/buildbot
+	>=dev-python/autobahn-0.16.0[${PYTHON_USEDEP}]
 	>=dev-python/twisted-17.9.0[${PYTHON_USEDEP}]
 	dev-python/future[${PYTHON_USEDEP}]
 	!<dev-util/buildbot-1.0.0
 "
 BDEPEND="
+	>=dev-python/msgpack-0.6.0[${PYTHON_USEDEP}]
 	test? (
 		${RDEPEND}
 		dev-python/mock[${PYTHON_USEDEP}]
+		dev-python/psutil[${PYTHON_USEDEP}]
 	)
 "
 

diff --git a/dev-util/buildbot-worker/files/buildbot_worker.initd2 b/dev-util/buildbot-worker/files/buildbot_worker.initd2
index 453d207e5d88..4ebfdd452926 100644
--- a/dev-util/buildbot-worker/files/buildbot_worker.initd2
+++ b/dev-util/buildbot-worker/files/buildbot_worker.initd2
@@ -1,8 +1,8 @@
 #!/sbin/openrc-run
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-BUILDWORKER_NAME=${RC_SVCNAME:16}
+BUILDWORKER_NAME=${RC_SVCNAME#*.}
 BUILDWORKER_PATH="${BASEDIR}/${BUILDWORKER_NAME}"
 depend() {
 	need net


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-30  0:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-13 20:48 [gentoo-commits] repo/gentoo:master commit in: dev-util/buildbot-worker/, dev-util/buildbot-worker/files/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2022-05-30  0:11 Brian Dolbec
2018-06-27 15:24 Brian Dolbec
2017-08-21 22:34 Brian Dolbec
2017-01-06  0:48 Brian Dolbec
2016-08-09 23:52 Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox