customize
This commit is contained in:
parent
005182d197
commit
f0d36055ad
13
master.cfg
13
master.cfg
@ -3,7 +3,7 @@
|
||||
|
||||
import os
|
||||
|
||||
from buildbot.plugins import worker, changes, util, steps, schedulers, reporters
|
||||
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
|
||||
@ -30,6 +30,7 @@ assert CLIENT_SECRET
|
||||
c["workers"] = [
|
||||
worker.Worker("worker-rust-1-65", "pass", properties={"rust_version": "1.65"}),
|
||||
worker.Worker("worker-rust-1-71", "pass", properties={"rust_version": "1.71"}),
|
||||
worker.Worker("worker-rust-mdbook", "pass"),
|
||||
]
|
||||
rust_workers_1_65 = ["worker-rust-1-65"]
|
||||
rust_workers_1_71 = ["worker-rust-1-71"]
|
||||
@ -91,7 +92,7 @@ env = {"CARGO_TARGET_DIR": CARGO_TARGET_DIR}
|
||||
DOC_DIR = f"{CARGO_TARGET_DIR}/doc"
|
||||
|
||||
|
||||
def basic_factory():
|
||||
def radn_rs_factory():
|
||||
factory = util.BuildFactory()
|
||||
factory.addStep(
|
||||
steps.Git(
|
||||
@ -109,7 +110,7 @@ def append_factory(factory, name: str, workernames: list[str]):
|
||||
|
||||
|
||||
def cargo_test(name: str, workernames: list[str]):
|
||||
factory = basic_factory()
|
||||
factory = radn_rs_factory()
|
||||
factory.addStep(
|
||||
steps.ShellCommand(
|
||||
command=["cargo", "test"],
|
||||
@ -120,7 +121,7 @@ def cargo_test(name: str, workernames: list[str]):
|
||||
|
||||
|
||||
def cargo_clippy(name: str, workernames: list[str]):
|
||||
factory = basic_factory()
|
||||
factory = radn_rs_factory()
|
||||
factory.addStep(
|
||||
steps.ShellCommand(
|
||||
command=[
|
||||
@ -139,7 +140,7 @@ def cargo_clippy(name: str, workernames: list[str]):
|
||||
|
||||
|
||||
def cargo_fmt(name: str, workernames: list[str]):
|
||||
factory = basic_factory()
|
||||
factory = radn_rs_factory()
|
||||
factory.addStep(
|
||||
steps.ShellCommand(
|
||||
command=[
|
||||
@ -155,7 +156,7 @@ def cargo_fmt(name: str, workernames: list[str]):
|
||||
|
||||
|
||||
def cargo_doc(name: str, workernames: list[str], specific: bool, latest: bool):
|
||||
factory = basic_factory()
|
||||
factory = radn_rs_factory()
|
||||
factory.addStep(
|
||||
steps.ShellCommand(
|
||||
command=[
|
||||
|
@ -71,6 +71,19 @@ services:
|
||||
networks:
|
||||
- buildbot-worker
|
||||
|
||||
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
|
||||
|
||||
nginx:
|
||||
container_name: buildbot-nginx
|
||||
build:
|
||||
|
@ -4,7 +4,9 @@ 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", "twistd", "--pidfile=", "-ny", "buildbot.tac"]
|
||||
CMD ["/usr/bin/dumb-init", "/buildbot/venv/bin/twistd", "--pidfile=", "-ny", "buildbot.tac"]
|
||||
|
10
worker/Dockerfile.mdbook
Normal file
10
worker/Dockerfile.mdbook
Normal file
@ -0,0 +1,10 @@
|
||||
FROM rust:1.72
|
||||
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"]
|
3
worker/worker-setup-user.sh
Normal file
3
worker/worker-setup-user.sh
Normal 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
|
@ -3,16 +3,15 @@ apt-get update \
|
||||
&& apt-get -y install -q \
|
||||
build-essential \
|
||||
git \
|
||||
python3-dev \
|
||||
libffi-dev \
|
||||
libssl-dev \
|
||||
python3-dev \
|
||||
python3-setuptools \
|
||||
python3-pip \
|
||||
python3-venv \
|
||||
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