customize
This commit is contained in:
parent
36bd6ee650
commit
92a96c55dc
16
master.cfg
16
master.cfg
@ -59,26 +59,20 @@ c["change_source"].append(
|
|||||||
# Configure the Schedulers, which decide how to react to incoming changes. In this
|
# Configure the Schedulers, which decide how to react to incoming changes. In this
|
||||||
# case, just kick off a 'runtests' build
|
# case, just kick off a 'runtests' build
|
||||||
|
|
||||||
|
builderNames = ["runtests"]
|
||||||
|
if GITEA_SECRET:
|
||||||
|
builderNames.append("runtests-gitea")
|
||||||
c["schedulers"] = []
|
c["schedulers"] = []
|
||||||
c["schedulers"].append(
|
c["schedulers"].append(
|
||||||
schedulers.SingleBranchScheduler(
|
schedulers.SingleBranchScheduler(
|
||||||
name="all",
|
name="all",
|
||||||
change_filter=util.ChangeFilter(branch="main"),
|
change_filter=util.ChangeFilter(branch="main"),
|
||||||
treeStableTimer=None,
|
treeStableTimer=None,
|
||||||
builderNames=["runtests"],
|
builderNames=builderNames,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if GITEA_SECRET:
|
|
||||||
c["schedulers"].append(
|
|
||||||
schedulers.SingleBranchScheduler(
|
|
||||||
name="all-gitea",
|
|
||||||
change_filter=util.ChangeFilter(branch="main"),
|
|
||||||
treeStableTimer=None,
|
|
||||||
builderNames=["runtests-gitea"],
|
|
||||||
)
|
|
||||||
)
|
|
||||||
c["schedulers"].append(
|
c["schedulers"].append(
|
||||||
schedulers.ForceScheduler(name="force", builderNames=["runtests"])
|
schedulers.ForceScheduler(name="force", builderNames=builderNames)
|
||||||
)
|
)
|
||||||
|
|
||||||
####### BUILDERS
|
####### BUILDERS
|
||||||
|
@ -1,21 +1,6 @@
|
|||||||
FROM rust:1.71
|
FROM rust:1.65
|
||||||
RUN apt-get update && apt-get -y upgrade
|
COPY worker-setup.sh worker-setup.sh
|
||||||
RUN apt-get update && apt-get -y install -q\
|
RUN bash worker-setup.sh
|
||||||
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
|
USER buildbot
|
||||||
WORKDIR /buildbot
|
WORKDIR /buildbot
|
||||||
COPY buildbot.tac /buildbot/buildbot.tac
|
COPY buildbot.tac /buildbot/buildbot.tac
|
||||||
|
@ -2,23 +2,20 @@ import fnmatch
|
|||||||
import os
|
import os
|
||||||
import sys
|
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
|
from buildbot_worker.bot import Worker
|
||||||
|
from twisted.application import service
|
||||||
|
from twisted.python.log import FileLogObserver, ILogObserver
|
||||||
|
|
||||||
# setup worker
|
# setup worker
|
||||||
basedir = os.environ.get("BUILDBOT_BASEDIR",
|
basedir = os.environ.get("BUILDBOT_BASEDIR", os.path.abspath(os.path.dirname(__file__)))
|
||||||
os.path.abspath(os.path.dirname(__file__)))
|
application = service.Application("buildbot-worker")
|
||||||
application = service.Application('buildbot-worker')
|
|
||||||
|
|
||||||
|
|
||||||
application.setComponent(ILogObserver, FileLogObserver(sys.stdout).emit)
|
application.setComponent(ILogObserver, FileLogObserver(sys.stdout).emit)
|
||||||
# and worker on the same process!
|
# and worker on the same process!
|
||||||
buildmaster_host = os.environ.get("BUILDMASTER", 'localhost')
|
buildmaster_host = os.environ.get("BUILDMASTER", "localhost")
|
||||||
port = int(os.environ.get("BUILDMASTER_PORT", 9989))
|
port = int(os.environ.get("BUILDMASTER_PORT", 9989))
|
||||||
workername = os.environ.get("WORKERNAME", 'docker')
|
workername = os.environ.get("WORKERNAME", "docker")
|
||||||
passwd = os.environ.get("WORKERPASS")
|
passwd = os.environ.get("WORKERPASS")
|
||||||
|
|
||||||
# delete the password from the environ so that it is not leaked in the log
|
# delete the password from the environ so that it is not leaked in the log
|
||||||
@ -35,8 +32,17 @@ allow_shutdown = None
|
|||||||
maxretries = 10
|
maxretries = 10
|
||||||
delete_leftover_dirs = False
|
delete_leftover_dirs = False
|
||||||
|
|
||||||
s = Worker(buildmaster_host, port, workername, passwd, basedir,
|
s = Worker(
|
||||||
keepalive, umask=umask, maxdelay=maxdelay,
|
buildmaster_host,
|
||||||
allow_shutdown=allow_shutdown, maxRetries=maxretries,
|
port,
|
||||||
delete_leftover_dirs=delete_leftover_dirs)
|
workername,
|
||||||
|
passwd,
|
||||||
|
basedir,
|
||||||
|
keepalive,
|
||||||
|
umask=umask,
|
||||||
|
maxdelay=maxdelay,
|
||||||
|
allow_shutdown=allow_shutdown,
|
||||||
|
maxRetries=maxretries,
|
||||||
|
delete_leftover_dirs=delete_leftover_dirs,
|
||||||
|
)
|
||||||
s.setServiceParent(application)
|
s.setServiceParent(application)
|
||||||
|
18
worker/worker-setup.sh
Normal file
18
worker/worker-setup.sh
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
apt-get update \
|
||||||
|
&& apt-get -y upgrade \
|
||||||
|
&& apt-get -y install -q \
|
||||||
|
build-essential \
|
||||||
|
git \
|
||||||
|
python3-dev \
|
||||||
|
libffi-dev \
|
||||||
|
libssl-dev \
|
||||||
|
python3-setuptools \
|
||||||
|
python3-pip \
|
||||||
|
dumb-init \
|
||||||
|
curl \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& pip3 --no-cache-dir install 'twisted[tls]' \
|
||||||
|
&& mkdir /buildbot \
|
||||||
|
&& useradd -ms /bin/bash buildbot \
|
||||||
|
&& pip3 install buildbot-worker \
|
||||||
|
&& chown -R buildbot /buildbot
|
Loading…
Reference in New Issue
Block a user