Compare commits

...

95 Commits

Author SHA1 Message Date
48d4fed4ef
remove compose version 2024-06-30 05:39:29 +00:00
89033ead4d
update rust for mdbook 2024-06-30 05:39:20 +00:00
0a3219367a
fixed master version 2024-06-30 05:39:08 +00:00
7690900847
../data/docs 2024-06-30 01:56:45 +00:00
97cb92f3cd
data directory + restart 2024-06-29 19:43:32 +00:00
8db8193128 customize 2023-09-25 00:54:43 +00:00
b2448fea92 customize 2023-09-25 00:53:08 +00:00
439248f270 customize 2023-08-31 21:13:03 +00:00
c64189afe5 customize 2023-08-31 16:23:18 +00:00
86aa6bb4b8 customize 2023-08-26 17:41:41 +00:00
b9d8fb6335 customize 2023-08-26 17:27:14 +00:00
e55b90445b customize 2023-08-26 17:25:41 +00:00
bedb1e77fe customize 2023-08-26 17:25:06 +00:00
f0d36055ad customize 2023-08-26 17:14:22 +00:00
005182d197 customize 2023-08-06 01:17:38 +00:00
42605fe699 customize 2023-08-06 01:10:56 +00:00
b133d8a135 customize 2023-08-05 17:57:14 +00:00
7f4cefd0a6 customize 2023-08-05 17:46:20 +00:00
d81b03d16c customize 2023-08-05 17:45:50 +00:00
41ab44875d customize 2023-08-05 17:35:14 +00:00
b368bf9049 customize 2023-08-05 17:34:35 +00:00
42e61f8ceb customize 2023-08-05 17:33:40 +00:00
76474a2773 customize 2023-08-05 17:23:58 +00:00
c8824cc43b customize 2023-08-05 17:19:50 +00:00
97736c1209 customize 2023-08-05 17:18:49 +00:00
68cd1058fd customize 2023-08-05 17:15:45 +00:00
2be7eab67d customize 2023-08-05 17:06:48 +00:00
a514acb736 customize 2023-08-05 17:05:46 +00:00
3fcf878ac1 customize 2023-08-05 17:04:24 +00:00
f7d2abc45f customize 2023-08-05 17:03:18 +00:00
1a33dc96f9 customize 2023-08-05 17:01:06 +00:00
412e675e47 customize 2023-08-05 16:59:22 +00:00
b201adeeb2 customize 2023-08-05 16:55:22 +00:00
9fbd6be1e6 customize 2023-08-05 16:54:05 +00:00
04faa3d073 rename 2023-08-05 16:21:12 +00:00
5ec9e3471a customize 2023-08-05 15:33:15 +00:00
9d00bbae1e customize 2023-08-05 15:17:41 +00:00
cee626d845 customize 2023-08-05 15:03:49 +00:00
2bd51e2376 customize 2023-08-05 15:01:00 +00:00
d3a7d2dcf8 customize 2023-08-05 13:14:52 +00:00
a4834f9784 customize 2023-08-05 12:30:05 +00:00
203c3e4c4e customize 2023-08-05 12:21:45 +00:00
4eecd70c56 customize 2023-08-05 12:20:21 +00:00
a7f0775808 customize 2023-08-05 12:11:14 +00:00
64dce7dad9 customize 2023-08-05 12:05:13 +00:00
746ba2da0b customize 2023-08-05 11:55:38 +00:00
4fe145108e customize 2023-08-05 11:49:11 +00:00
7b4a1c8e34 customize 2023-08-05 11:48:22 +00:00
4f9786b403 customize 2023-08-05 11:46:47 +00:00
c3727f5e4f customize 2023-08-05 11:43:47 +00:00
e02119c15c customize 2023-08-05 11:33:12 +00:00
055404504c customize 2023-08-05 11:29:28 +00:00
0afef8ef5b customize 2023-08-05 11:21:35 +00:00
bae787a244 customize 2023-08-05 11:20:32 +00:00
6c7f961674 customize 2023-08-05 11:19:04 +00:00
79c0838d9c customize 2023-08-05 10:51:00 +00:00
36339e42a0 customize 2023-08-04 23:40:13 +00:00
e3227e2345 customize 2023-08-04 23:34:11 +00:00
92a96c55dc customize 2023-08-04 23:31:33 +00:00
36bd6ee650 customize 2023-08-04 22:42:38 +00:00
945580d7cf customize 2023-08-04 21:06:35 +00:00
d3608bddfb customize 2023-08-04 20:59:14 +00:00
72fc43bb1c customize 2023-08-04 20:55:34 +00:00
3d0870d431 customize 2023-08-04 20:54:55 +00:00
ec2b11ca1c customize 2023-08-04 20:51:42 +00:00
c8117779f8 customize 2023-08-04 20:24:16 +00:00
efdd3f9268 customize 2023-08-04 20:21:25 +00:00
84236fee76 customize 2023-08-04 20:19:59 +00:00
70f28b0823 customize 2023-08-04 20:15:03 +00:00
5a0c94f253 customize 2023-08-04 19:59:53 +00:00
f5f71dc0cc customize 2023-08-04 19:51:53 +00:00
c260c85855 customize 2023-08-04 19:48:30 +00:00
624b3ed609 customize 2023-08-04 19:37:18 +00:00
1defda446b customize 2023-08-04 18:53:58 +00:00
7238b65496 customize 2023-08-04 18:38:36 +00:00
cd1560cb40 customize 2023-08-04 18:18:26 +00:00
0fd8ec9aeb customize 2023-08-04 17:19:27 +00:00
9186e0f0ac customize 2023-08-04 16:42:34 +00:00
Pierre Tardy
a3eebec372
Merge pull request #22 from Blockton-News/master
build and css
2021-05-29 13:19:08 +02:00
greenOG-stack
1100ff52e2
read.me
all builds need to be monitored
2021-05-28 11:11:12 -05:00
Povilas Kanapickas
81bb62ae26
Merge pull request #21 from seimonw/master
BuildmasterConfig key 'status' is deprecated
2021-03-25 12:07:37 +02:00
Seimon Williams
0c2ea447d8
BuildmasterConfig key 'status' is deprecated 2021-03-23 16:08:56 +00:00
Pierre Tardy
ab2b3af1d1
Update Dockerfile
switch to python3
2019-07-08 13:04:34 +02:00
Pierre Tardy
646dd64c7a
Merge pull request #12 from matelakat/amend-port-for-twisted
Amend twisted configuration
2018-04-30 16:46:53 +02:00
Mate Lakat
f24cd2553d Amend twisted configuration
It seems twisted wants to see the protocol as well, not just a bare port
number. Without this we got:

```
exceptions.ValueError: Unknown endpoint type: '8010'
```
2018-04-30 16:21:02 +02:00
Pierre Tardy
69fc1f3da7
Merge pull request #6 from perlun/patch-1
docker-compose.yml: Sanitize whitespace usage
2018-03-29 09:16:57 +02:00
Pierre Tardy
5d80ed5e7d
Merge branch 'master' into patch-1 2018-03-29 09:16:49 +02:00
Pierre Tardy
0d122de59a
Merge pull request #5 from jessecooper/fix-port-to-match-docs
changed web port to 8010 to match bbdocs
2018-03-29 09:15:57 +02:00
Per Lundberg
169592cae4
docker-compose.yml: Sanitize whitespace usage
I noted when looking at the file that it was a bit messy because it used a mix of 2 and 4 spaces as indentation width in the YAML. [yamllint](https://github.com/adrienverge/yamllint) also showed warnings about the same things.

I cleaned the file up, so that the indentation would be harmonized and give people a better first impression of a great tool (=buildbot).
2017-11-02 11:36:13 +02:00
Jesse Cooper
b4c8ad747d changed web port to 8010 to match bbdocs 2017-06-26 09:39:23 -05:00
Pierre Tardy
c56d888dd3
use buildbot nine! 2017-04-28 11:43:37 +02:00
Pierre Tardy
8de56711b8
add worker 2016-12-20 16:36:45 +01:00
Pierre Tardy
87dd56fc12
0.9.2 2016-12-20 16:23:51 +01:00
Pierre Tardy
f083d3ad77
0.8.12 2016-12-20 16:18:46 +01:00
Pierre Tardy
4c51cd2ce7
logfileoptims 2016-12-19 22:25:59 +01:00
18 changed files with 552 additions and 77 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/venv
gitea.env
/data

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"python.analysis.typeCheckingMode": "basic"
}

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# buildbot-docker-example-config
example configuration for running buildbot in docker

View File

@ -3,7 +3,8 @@
import os
from buildbot.plugins import *
from buildbot.plugins import changes, reporters, schedulers, steps, util, worker
from buildbot.www.authz.roles import RolesFromBase
# This is a sample buildmaster config file. It must be installed as
# 'master.cfg' in your buildmaster's base directory.
@ -12,55 +13,67 @@ from buildbot.plugins import *
# a shorter alias to save typing.
c = BuildmasterConfig = {}
GITEA_SECRET = os.environ.get("GITEA_SECRET")
GITEA_TOKEN = os.environ.get("GITEA_TOKEN")
CLIENT_ID = os.environ.get("GITEA_CLIENT_ID")
assert CLIENT_ID
CLIENT_SECRET = os.environ.get("GITEA_CLIENT_SECRET")
assert CLIENT_SECRET
####### WORKERS
# The 'workers' list defines the set of recognized workers. Each element is
# a Worker object, specifying a unique worker name and password. The same
# worker name and password must be configured on the worker.
c['workers'] = [worker.Worker("example-worker", 'pass')]
c["workers"] = [
worker.Worker("worker-rust-1-65", "pass", properties={"rust_version": "1.65"}),
worker.Worker("worker-rust-1-72", "pass", properties={"rust_version": "1.72"}),
worker.Worker("worker-rust-mdbook", "pass"),
]
rust_workers_1_65 = ["worker-rust-1-65"]
rust_workers_1_72 = ["worker-rust-1-72"]
rust_workers_mdbook = ["worker-rust-mdbook"]
if 'BUILDBOT_MQ_URL' in os.environ:
c['mq'] = {
'type' : 'wamp',
'router_url': os.environ['BUILDBOT_MQ_URL'],
'realm': os.environ.get('BUILDBOT_MQ_REALM', 'buildbot').decode('utf-8'),
'debug' : 'BUILDBOT_MQ_DEBUG' in os.environ,
'debug_websockets' : 'BUILDBOT_MQ_DEBUG' in os.environ,
'debug_lowlevel' : 'BUILDBOT_MQ_DEBUG' in os.environ,
if "BUILDBOT_MQ_URL" in os.environ:
c["mq"] = {
"type": "wamp",
"router_url": os.environ["BUILDBOT_MQ_URL"],
"realm": os.environ.get("BUILDBOT_MQ_REALM", "buildbot"),
"debug": "BUILDBOT_MQ_DEBUG" in os.environ,
"debug_websockets": "BUILDBOT_MQ_DEBUG" in os.environ,
"debug_lowlevel": "BUILDBOT_MQ_DEBUG" in os.environ,
}
# 'protocols' contains information about protocols which master will use for
# communicating with workers. You must define at least 'port' option that workers
# could connect to your master with this protocol.
# 'port' must match the value configured into the workers (with their
# --master option)
c['protocols'] = {'pb': {'port': os.environ.get("BUILDBOT_WORKER_PORT", 9989)}}
c["protocols"] = {"pb": {"port": os.environ.get("BUILDBOT_WORKER_PORT", 9989)}}
####### CHANGESOURCES
# the 'change_source' setting tells the buildmaster how it should find out
# about source code changes. Here we point to the buildbot clone of pyflakes.
# about source code changes. Here we point to the buildbot clone of radn.
c['change_source'] = []
c['change_source'].append(changes.GitPoller(
'git://github.com/buildbot/pyflakes.git',
workdir='gitpoller-workdir', branch='master',
pollinterval=300))
####### SCHEDULERS
# Configure the Schedulers, which decide how to react to incoming changes. In this
# case, just kick off a 'runtests' build
c['schedulers'] = []
c['schedulers'].append(schedulers.SingleBranchScheduler(
name="all",
change_filter=util.ChangeFilter(branch='master'),
treeStableTimer=None,
builderNames=["runtests"]))
c['schedulers'].append(schedulers.ForceScheduler(
name="force",
builderNames=["runtests"]))
c["change_source"] = []
c["change_source"].append(
changes.GitPoller(
"https://gitea.parrrate.ru/PTV/radn-rs.git",
workdir="gitpoller/radn-rs",
branch="main",
pollinterval=300,
)
)
c["change_source"].append(
changes.GitPoller(
"https://gitea.parrrate.ru/PTV/exercises.git",
workdir="gitpoller/exercises",
branch="latest",
pollinterval=300,
)
)
####### BUILDERS
@ -68,49 +81,258 @@ c['schedulers'].append(schedulers.ForceScheduler(
# what steps, and which workers can execute them. Note that any particular build will
# only take place on one worker.
factory = util.BuildFactory()
# check out the source
factory.addStep(steps.Git(repourl='http://github.com/buildbot/pyflakes.git', mode='incremental'))
# run the tests (note that this will require that 'trial' is installed)
factory.addStep(steps.ShellCommand(command=["trial", "pyflakes"]))
# all_repositories = {
# r"https://gitea.parrrate.ru/PTV/radn-rs.git": "radn-rs",
# }
c['builders'] = []
c['builders'].append(
util.BuilderConfig(name="runtests",
workernames=["example-worker"],
factory=factory))
####### STATUS TARGETS
# def codebaseGenerator(chdict):
# return all_repositories.get(chdict["repository"])
# 'status' is a list of Status Targets. The results of each build will be
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
# c["codebaseGenerator"] = codebaseGenerator
c["builders"] = []
radn_builders = []
exercises_builders = []
CARGO_TARGET_DIR = "/buildbot/_rust/radn-rs/target"
RADN_ENV = {"CARGO_TARGET_DIR": CARGO_TARGET_DIR}
DOC_DIR = f"{CARGO_TARGET_DIR}/doc"
def radn_rs_factory():
factory = util.BuildFactory()
factory.addStep(
steps.Git(
repourl="https://gitea.parrrate.ru/PTV/radn-rs.git", mode="incremental"
)
)
return factory
def exercises_factory():
factory = util.BuildFactory()
factory.addStep(
steps.Git(
repourl="https://gitea.parrrate.ru/PTV/exercises.git", mode="incremental"
)
)
return factory
def radn_append_factory(factory, name: str, workernames: list[str]):
c["builders"].append(
util.BuilderConfig(name=name, workernames=workernames, factory=factory)
)
radn_builders.append(name)
def exercises_append_factory(factory, name: str, workernames: list[str]):
c["builders"].append(
util.BuilderConfig(name=name, workernames=workernames, factory=factory)
)
exercises_builders.append(name)
def cargo_test(name: str, workernames: list[str]):
factory = radn_rs_factory()
factory.addStep(
steps.ShellCommand(
command=["cargo", "test", "--workspace"],
env=RADN_ENV,
)
)
radn_append_factory(factory, name, workernames)
def cargo_clippy(name: str, workernames: list[str]):
factory = radn_rs_factory()
factory.addStep(
steps.ShellCommand(
command=[
"cargo",
"clippy",
"--workspace",
"--examples",
"--tests",
"--",
"--deny=warnings",
],
env=RADN_ENV,
)
)
radn_append_factory(factory, name, workernames)
def cargo_fmt(name: str, workernames: list[str]):
factory = radn_rs_factory()
factory.addStep(
steps.ShellCommand(
command=[
"cargo",
"fmt",
"--check",
"--all",
],
env=RADN_ENV,
)
)
radn_append_factory(factory, name, workernames)
def cargo_doc(name: str, workernames: list[str], specific: bool, latest: bool):
factory = radn_rs_factory()
factory.addStep(
steps.ShellCommand(
command=[
"cargo",
"doc",
"--workspace",
"--no-deps",
],
env=RADN_ENV,
)
)
if specific:
factory.addStep(
steps.DirectoryUpload(
workersrc=DOC_DIR,
masterdest=util.Interpolate(
"/buildbot_share/docs/radn-rs/%(prop:rust_version)s/"
),
url=util.Interpolate(
"https://radn.parrrate.ru/latest/docs/%(prop:rust_version)s/radn/"
),
compress="gz",
)
)
if latest:
factory.addStep(
steps.DirectoryUpload(
workersrc=DOC_DIR,
masterdest="/buildbot_share/docs/radn-rs/",
url="https://radn.parrrate.ru/latest/docs/radn/",
compress="gz",
)
)
radn_append_factory(factory, name, workernames)
def mdbook_test(name: str, workernames: list[str]):
factory = exercises_factory()
factory.addStep(
steps.ShellCommand(
command=["mdbook", "test", "."],
)
)
exercises_append_factory(factory, name, workernames)
cargo_test("cargo test (1.65)", rust_workers_1_65)
cargo_clippy("cargo clippy (1.65)", rust_workers_1_65)
cargo_clippy("cargo clippy (1.72)", rust_workers_1_72)
cargo_fmt("cargo fmt (1.72)", rust_workers_1_72)
cargo_doc("cargo doc (1.72)", rust_workers_1_72, False, True)
mdbook_test("mdbook test", rust_workers_mdbook)
####### SCHEDULERS
# Configure the Schedulers, which decide how to react to incoming changes.
c["schedulers"] = []
c["schedulers"].append(
schedulers.SingleBranchScheduler(
name="all-radn",
change_filter=util.ChangeFilter(branch="main"),
treeStableTimer=None,
builderNames=radn_builders,
)
)
c["schedulers"].append(
schedulers.SingleBranchScheduler(
name="all-exercises",
change_filter=util.ChangeFilter(branch="latest"),
treeStableTimer=None,
builderNames=exercises_builders,
)
)
c["schedulers"].append(
schedulers.ForceScheduler(name="force-radn", builderNames=radn_builders)
)
c["schedulers"].append(
schedulers.ForceScheduler(name="force-exercises", builderNames=exercises_builders)
)
####### REPORTER TARGETS
# 'services' is a list of Reporter Targets. The results of each build will be
# pushed to these targets. buildbot/reporters/*.py has a variety to choose from,
# like IRC bots.
c['status'] = []
c["services"] = []
####### PROJECT IDENTITY
# the 'title' string will appear at the top of this buildbot installation's
# home pages (linked to the 'titleURL').
c['title'] = "Pyflakes"
c['titleURL'] = "https://launchpad.net/pyflakes"
c["title"] = "RADN"
c["titleURL"] = "https://gitea.parrrate.ru/PTV/radn-rs"
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server is visible. This typically uses the port number set in
# the 'www' entry below, but with an externally-visible host name which the
# buildbot cannot figure out without some help.
c['buildbotURL'] = os.environ.get("BUILDBOT_WEB_URL", "http://localhost:8010/")
c["buildbotURL"] = os.environ.get("BUILDBOT_WEB_URL", "http://localhost:8010/")
class RolesFromCustom(RolesFromBase):
def getRolesFromUser(self, userDetails: dict):
if userDetails.get("is_admin") is True:
return ["admins"]
else:
return []
# minimalistic config to activate new web UI
c['www'] = dict(port=os.environ.get("BUILDBOT_WEB_PORT", 8010),
plugins=dict(waterfall_view={}, console_view={}))
c["www"] = {
"port": os.environ.get("BUILDBOT_WEB_PORT", 8010),
"plugins": {
"waterfall_view": {},
"console_view": {},
},
"change_hook_dialects": {},
"auth": util.GiteaAuth(
endpoint="https://gitea.parrrate.ru",
client_id=CLIENT_ID,
client_secret=CLIENT_SECRET,
),
"authz": util.Authz(
allowRules=[util.AnyControlEndpointMatcher(role="admins")],
roleMatchers=[RolesFromCustom()],
),
}
if GITEA_SECRET:
c["www"]["change_hook_dialects"]["gitea"] = {
"secret": GITEA_SECRET,
"onlyIncludePushCommit": True,
}
if GITEA_TOKEN:
c["services"].append(
reporters.GiteaStatusPush(
"https://gitea.parrrate.ru", token=GITEA_TOKEN, verbose=True
),
)
####### DB URL
c['db'] = {
c["db"] = {
# This specifies what database buildbot uses to store its state. You can leave
# this at its default for all but the largest installations.
'db_url' : os.environ.get("BUILDBOT_DB_URL", "sqlite://").format(**os.environ),
"db_url": os.environ.get("BUILDBOT_DB_URL", "sqlite://").format(**os.environ),
}
c["buildbotNetUsageData"] = None

2
master/Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM buildbot/buildbot-master:v3.11.5
RUN /buildbot_venv/bin/pip3 install buildbot_gitea

View File

@ -19,7 +19,7 @@ services:
env_file: db.env
environment:
- BUILDBOT_CONFIG_DIR=config
- BUILDBOT_CONFIG_URL=https://github.com/buildbot/buildbot-docker-example-config/archive/master.tar.gz
- BUILDBOT_CONFIG_URL=https://gitea.parrrate.ru/PTV/buildbot/archive/master.tar.gz
- BUILDBOT_WORKER_PORT=9989
- BUILDBOT_WEB_URL=http://localhost:8080/
- BUILDBOT_WEB_PORT=8080

View File

@ -1,2 +1,2 @@
from pypy:2-onbuild
FROM pypy:3-onbuild
CMD /usr/src/app/start_buildbot.sh

2
pypy/worker/Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM pypy:2-onbuild
CMD ["twistd", "-ny", "buildbot.tac"]

40
pypy/worker/buildbot.tac Normal file
View File

@ -0,0 +1,40 @@
import fnmatch
import os
import sys
from twisted.application import service
from twisted.python.log import FileLogObserver
from twisted.python.log import ILogObserver
from buildslave.bot import BuildSlave
# setup worker
basedir = os.path.abspath(os.path.dirname(__file__))
application = service.Application('buildbot-worker')
application.setComponent(ILogObserver, FileLogObserver(sys.stdout).emit)
# and worker on the same process!
buildmaster_host = os.environ.get("BUILDMASTER", 'localhost')
port = int(os.environ.get("BUILDMASTER_PORT", 9989))
workername = os.environ.get("WORKERNAME", 'docker')
passwd = os.environ.get("WORKERPASS")
# delete the password from the environ so that it is not leaked in the log
blacklist = os.environ.get("WORKER_ENVIRONMENT_BLACKLIST", "WORKERPASS").split()
for name in list(os.environ.keys()):
for toremove in blacklist:
if fnmatch.fnmatch(name, toremove):
del os.environ[name]
keepalive = 600
umask = None
maxdelay = 300
allow_shutdown = None
usepty=False
s = BuildSlave(buildmaster_host, port, workername, passwd, basedir,
keepalive, usepty, umask=umask, maxdelay=maxdelay,
allow_shutdown=allow_shutdown)
s.setServiceParent(application)

View File

@ -0,0 +1 @@
buildbot-slave==0.8.14

2
simple/Dockerfile.Nginx Normal file
View File

@ -0,0 +1,2 @@
FROM nginx
COPY nginx-default.conf /etc/nginx/conf.d/default.conf

View File

@ -1,36 +1,122 @@
version: '2'
networks:
v6d:
external: true
buildbot-db: {}
buildbot-worker: {}
buildbot-docs: {}
services:
buildbot:
image: buildbot/buildbot-master:master
image: "buildbot-master-parrrate"
build: ../master
env_file:
- db.env
- db.env
- gitea.env
environment:
- BUILDBOT_CONFIG_DIR=config
- BUILDBOT_CONFIG_URL=https://github.com/buildbot/buildbot-docker-example-config/archive/master.tar.gz
- BUILDBOT_WORKER_PORT=9989
- BUILDBOT_WEB_URL=http://localhost:8080/
- BUILDBOT_WEB_PORT=8080
links:
- db
- BUILDBOT_CONFIG_DIR=config
- BUILDBOT_CONFIG_URL=https://gitea.parrrate.ru/PTV/buildbot/archive/master.tar.gz
- BUILDBOT_WORKER_PORT=9989
- BUILDBOT_WEB_URL=https://buildbot.parrrate.ru/
- BUILDBOT_WEB_PORT=tcp:port=8010
depends_on:
- db
ports:
- "8080:8080"
- "8010:8010"
networks:
- v6d
- buildbot-db
- buildbot-worker
volumes:
- ../data/docs:/buildbot_share/docs/:rw
deploy:
restart_policy:
condition: unless-stopped
delay: 30s
window: 300s
db:
env_file:
- db.env
- db.env
image: "postgres:9.4"
expose:
- 5432
- 5432
networks:
- buildbot-db
volumes:
- ../data/db:/var/lib/postgresql/data
deploy:
restart_policy:
condition: unless-stopped
delay: 30s
window: 300s
worker:
image: "buildbot/buildbot-worker:master"
rust-worker-1-65:
build:
context: ../worker
args:
- RUST_VERSION_ARG=1.65
environment:
BUILDMASTER: buildbot
BUILDMASTER_PORT: 9989
WORKERNAME: example-worker
WORKERPASS: pass
WORKER_ENVIRONMENT_BLACKLIST: DOCKER_BUILDBOT* BUILDBOT_ENV_* BUILDBOT_1* WORKER_ENVIRONMENT_BLACKLIST
BUILDMASTER: buildbot
BUILDMASTER_PORT: 9989
WORKERNAME: worker-rust-1-65
WORKERPASS: pass
WORKER_ENVIRONMENT_BLACKLIST: DOCKER_BUILDBOT* BUILDBOT_ENV_* BUILDBOT_1* WORKER_ENVIRONMENT_BLACKLIST
networks:
- buildbot-worker
deploy:
restart_policy:
condition: unless-stopped
delay: 30s
window: 300s
links:
- buildbot
rust-worker-1-72:
build:
context: ../worker
args:
- RUST_VERSION_ARG=1.72
environment:
BUILDMASTER: buildbot
BUILDMASTER_PORT: 9989
WORKERNAME: worker-rust-1-72
WORKERPASS: pass
WORKER_ENVIRONMENT_BLACKLIST: DOCKER_BUILDBOT* BUILDBOT_ENV_* BUILDBOT_1* WORKER_ENVIRONMENT_BLACKLIST
networks:
- buildbot-worker
deploy:
restart_policy:
condition: unless-stopped
delay: 30s
window: 300s
rust-worker-mdbook:
build:
context: ../worker
dockerfile: Dockerfile.mdbook
environment:
BUILDMASTER: buildbot
BUILDMASTER_PORT: 9989
WORKERNAME: worker-rust-mdbook
WORKERPASS: pass
WORKER_ENVIRONMENT_BLACKLIST: DOCKER_BUILDBOT* BUILDBOT_ENV_* BUILDBOT_1* WORKER_ENVIRONMENT_BLACKLIST
networks:
- buildbot-worker
deploy:
restart_policy:
condition: unless-stopped
delay: 30s
window: 300s
nginx:
container_name: buildbot-nginx
build:
context: .
dockerfile: Dockerfile.Nginx
networks:
v6d: {}
volumes:
- ../data/docs:/buildbot_share/docs/:ro
deploy:
restart_policy:
condition: unless-stopped
delay: 30s
window: 300s

22
simple/nginx-default.conf Normal file
View File

@ -0,0 +1,22 @@
server {
listen 80;
listen [::]:80;
server_name radn.parrrate.ru;
location /docs {
root /buildbot_share;
index index.html index.htm;
autoindex on;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
server {
listen 80;
listen [::]:80;
server_name *.parrrate.ru;
}

12
worker/Dockerfile Normal file
View File

@ -0,0 +1,12 @@
ARG RUST_VERSION_ARG=1.65
FROM rust:${RUST_VERSION_ARG}
COPY worker-setup.sh worker-setup.sh
RUN bash worker-setup.sh
USER buildbot
WORKDIR /buildbot
COPY worker-setup-user.sh worker-setup-user.sh
RUN bash worker-setup-user.sh
COPY buildbot.tac /buildbot/buildbot.tac
RUN rustup component add clippy
RUN rustup component add rustfmt
CMD ["/usr/bin/dumb-init", "/buildbot/venv/bin/twistd", "--pidfile=", "-ny", "buildbot.tac"]

10
worker/Dockerfile.mdbook Normal file
View File

@ -0,0 +1,10 @@
FROM rust:1.79
COPY worker-setup.sh worker-setup.sh
RUN bash worker-setup.sh
USER buildbot
WORKDIR /buildbot
COPY worker-setup-user.sh worker-setup-user.sh
RUN bash worker-setup-user.sh
COPY buildbot.tac /buildbot/buildbot.tac
RUN cargo install mdbook
CMD ["/usr/bin/dumb-init", "/buildbot/venv/bin/twistd", "--pidfile=", "-ny", "buildbot.tac"]

48
worker/buildbot.tac Normal file
View File

@ -0,0 +1,48 @@
import fnmatch
import os
import sys
from buildbot_worker.bot import Worker
from twisted.application import service
from twisted.python.log import FileLogObserver, ILogObserver
# setup worker
basedir = os.environ.get("BUILDBOT_BASEDIR", os.path.abspath(os.path.dirname(__file__)))
application = service.Application("buildbot-worker")
application.setComponent(ILogObserver, FileLogObserver(sys.stdout).emit)
# and worker on the same process!
buildmaster_host = os.environ.get("BUILDMASTER", "localhost")
port = int(os.environ.get("BUILDMASTER_PORT", 9989))
workername = os.environ.get("WORKERNAME", "docker")
passwd = os.environ.get("WORKERPASS")
# delete the password from the environ so that it is not leaked in the log
blacklist = os.environ.get("WORKER_ENVIRONMENT_BLACKLIST", "WORKERPASS").split()
for name in list(os.environ.keys()):
for toremove in blacklist:
if fnmatch.fnmatch(name, toremove):
del os.environ[name]
keepalive = 600
umask = None
maxdelay = 300
allow_shutdown = None
maxretries = 10
delete_leftover_dirs = False
s = Worker(
buildmaster_host,
port,
workername,
passwd,
basedir,
keepalive,
umask=umask,
maxdelay=maxdelay,
allow_shutdown=allow_shutdown,
maxRetries=maxretries,
delete_leftover_dirs=delete_leftover_dirs,
)
s.setServiceParent(application)

View File

@ -0,0 +1,3 @@
python3 -m venv /buildbot/venv/
/buildbot/venv/bin/pip3 --no-cache-dir install 'twisted[tls]'
/buildbot/venv/bin/pip3 --no-cache-dir install buildbot-worker

17
worker/worker-setup.sh Normal file
View File

@ -0,0 +1,17 @@
apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install -q \
build-essential \
git \
libffi-dev \
libssl-dev \
python3-dev \
python3-setuptools \
python3-pip \
python3-venv \
dumb-init \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /buildbot \
&& useradd -ms /bin/bash buildbot \
&& chown -R buildbot /buildbot