customize
This commit is contained in:
parent
0fd8ec9aeb
commit
cd1560cb40
@ -43,7 +43,7 @@ c['protocols'] = {'pb': {'port': os.environ.get("BUILDBOT_WORKER_PORT", 9989)}}
|
|||||||
|
|
||||||
c['change_source'] = []
|
c['change_source'] = []
|
||||||
c['change_source'].append(changes.GitPoller(
|
c['change_source'].append(changes.GitPoller(
|
||||||
'git://https://gitea.parrrate.ru/PTV/radn-rs.git',
|
'git://gitea.parrrate.ru/PTV/radn-rs.git',
|
||||||
workdir='gitpoller-workdir', branch='master',
|
workdir='gitpoller-workdir', branch='master',
|
||||||
pollinterval=300))
|
pollinterval=300))
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
from pypy:3-onbuild
|
FROM pypy:3-onbuild
|
||||||
CMD /usr/src/app/start_buildbot.sh
|
CMD /usr/src/app/start_buildbot.sh
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
from pypy:2-onbuild
|
FROM pypy:2-onbuild
|
||||||
CMD ["twistd", "-ny", "buildbot.tac"]
|
CMD ["twistd", "-ny", "buildbot.tac"]
|
||||||
|
@ -24,7 +24,8 @@ services:
|
|||||||
- 5432
|
- 5432
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
image: "buildbot/buildbot-worker:master"
|
image: "buildbot-worker-rust"
|
||||||
|
build: ../worker
|
||||||
environment:
|
environment:
|
||||||
BUILDMASTER: buildbot
|
BUILDMASTER: buildbot
|
||||||
BUILDMASTER_PORT: 9989
|
BUILDMASTER_PORT: 9989
|
||||||
|
22
worker/Dockerfile
Normal file
22
worker/Dockerfile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
FROM rust:1.71
|
||||||
|
RUN apt-get update && apt-get -y upgrade
|
||||||
|
RUN apt-get update && apt-get -y install -q\
|
||||||
|
build-essential\
|
||||||
|
git\
|
||||||
|
python3-dev\
|
||||||
|
libffi-dev\
|
||||||
|
libssl-dev\
|
||||||
|
python3-setuptools\
|
||||||
|
python3-pip\
|
||||||
|
dumb-init\
|
||||||
|
curl
|
||||||
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN pip3 --no-cache-dir install 'twisted[tls]'
|
||||||
|
RUN mkdir /buildbot
|
||||||
|
RUN useradd -ms /bin/bash buildbot
|
||||||
|
RUN pip3 install buildbot-worker
|
||||||
|
RUN chown -R buildbot /buildbot
|
||||||
|
USER buildbot
|
||||||
|
WORKDIR /buildbot
|
||||||
|
COPY buildbot.tac /buildbot/buildbot.tac
|
||||||
|
CMD ["/usr/bin/dumb-init", "twistd", "--pidfile=", "-ny", "buildbot.tac"]
|
42
worker/buildbot.tac
Normal file
42
worker/buildbot.tac
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import fnmatch
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from twisted.application import service
|
||||||
|
from twisted.python.log import FileLogObserver
|
||||||
|
from twisted.python.log import ILogObserver
|
||||||
|
|
||||||
|
from buildbot_worker.bot import Worker
|
||||||
|
|
||||||
|
# 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)
|
Loading…
Reference in New Issue
Block a user