customize
This commit is contained in:
parent
005182d197
commit
f0d36055ad
13
master.cfg
13
master.cfg
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import os
|
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
|
from buildbot.www.authz.roles import RolesFromBase
|
||||||
|
|
||||||
# This is a sample buildmaster config file. It must be installed as
|
# This is a sample buildmaster config file. It must be installed as
|
||||||
@ -30,6 +30,7 @@ assert CLIENT_SECRET
|
|||||||
c["workers"] = [
|
c["workers"] = [
|
||||||
worker.Worker("worker-rust-1-65", "pass", properties={"rust_version": "1.65"}),
|
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-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_65 = ["worker-rust-1-65"]
|
||||||
rust_workers_1_71 = ["worker-rust-1-71"]
|
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"
|
DOC_DIR = f"{CARGO_TARGET_DIR}/doc"
|
||||||
|
|
||||||
|
|
||||||
def basic_factory():
|
def radn_rs_factory():
|
||||||
factory = util.BuildFactory()
|
factory = util.BuildFactory()
|
||||||
factory.addStep(
|
factory.addStep(
|
||||||
steps.Git(
|
steps.Git(
|
||||||
@ -109,7 +110,7 @@ def append_factory(factory, name: str, workernames: list[str]):
|
|||||||
|
|
||||||
|
|
||||||
def cargo_test(name: str, workernames: list[str]):
|
def cargo_test(name: str, workernames: list[str]):
|
||||||
factory = basic_factory()
|
factory = radn_rs_factory()
|
||||||
factory.addStep(
|
factory.addStep(
|
||||||
steps.ShellCommand(
|
steps.ShellCommand(
|
||||||
command=["cargo", "test"],
|
command=["cargo", "test"],
|
||||||
@ -120,7 +121,7 @@ def cargo_test(name: str, workernames: list[str]):
|
|||||||
|
|
||||||
|
|
||||||
def cargo_clippy(name: str, workernames: list[str]):
|
def cargo_clippy(name: str, workernames: list[str]):
|
||||||
factory = basic_factory()
|
factory = radn_rs_factory()
|
||||||
factory.addStep(
|
factory.addStep(
|
||||||
steps.ShellCommand(
|
steps.ShellCommand(
|
||||||
command=[
|
command=[
|
||||||
@ -139,7 +140,7 @@ def cargo_clippy(name: str, workernames: list[str]):
|
|||||||
|
|
||||||
|
|
||||||
def cargo_fmt(name: str, workernames: list[str]):
|
def cargo_fmt(name: str, workernames: list[str]):
|
||||||
factory = basic_factory()
|
factory = radn_rs_factory()
|
||||||
factory.addStep(
|
factory.addStep(
|
||||||
steps.ShellCommand(
|
steps.ShellCommand(
|
||||||
command=[
|
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):
|
def cargo_doc(name: str, workernames: list[str], specific: bool, latest: bool):
|
||||||
factory = basic_factory()
|
factory = radn_rs_factory()
|
||||||
factory.addStep(
|
factory.addStep(
|
||||||
steps.ShellCommand(
|
steps.ShellCommand(
|
||||||
command=[
|
command=[
|
||||||
|
@ -33,7 +33,7 @@ services:
|
|||||||
- buildbot-worker
|
- buildbot-worker
|
||||||
volumes:
|
volumes:
|
||||||
- buildbot-docs:/buildbot_share/docs/:rw
|
- buildbot-docs:/buildbot_share/docs/:rw
|
||||||
|
|
||||||
db:
|
db:
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
@ -71,6 +71,19 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- buildbot-worker
|
- 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:
|
nginx:
|
||||||
container_name: buildbot-nginx
|
container_name: buildbot-nginx
|
||||||
build:
|
build:
|
||||||
|
@ -4,7 +4,9 @@ COPY worker-setup.sh worker-setup.sh
|
|||||||
RUN bash worker-setup.sh
|
RUN bash worker-setup.sh
|
||||||
USER buildbot
|
USER buildbot
|
||||||
WORKDIR /buildbot
|
WORKDIR /buildbot
|
||||||
|
COPY worker-setup-user.sh worker-setup-user.sh
|
||||||
|
RUN bash worker-setup-user.sh
|
||||||
COPY buildbot.tac /buildbot/buildbot.tac
|
COPY buildbot.tac /buildbot/buildbot.tac
|
||||||
RUN rustup component add clippy
|
RUN rustup component add clippy
|
||||||
RUN rustup component add rustfmt
|
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 \
|
&& apt-get -y install -q \
|
||||||
build-essential \
|
build-essential \
|
||||||
git \
|
git \
|
||||||
python3-dev \
|
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
|
python3-dev \
|
||||||
python3-setuptools \
|
python3-setuptools \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
|
python3-venv \
|
||||||
dumb-init \
|
dumb-init \
|
||||||
curl \
|
curl \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& pip3 --no-cache-dir install 'twisted[tls]' \
|
|
||||||
&& mkdir /buildbot \
|
&& mkdir /buildbot \
|
||||||
&& useradd -ms /bin/bash buildbot \
|
&& useradd -ms /bin/bash buildbot \
|
||||||
&& pip3 install buildbot-worker \
|
|
||||||
&& chown -R buildbot /buildbot
|
&& chown -R buildbot /buildbot
|
||||||
|
Loading…
Reference in New Issue
Block a user