remove included docker and ssh runners
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
20286432ae
commit
be688da640
12
Dockerfile
12
Dockerfile
|
@ -2,15 +2,11 @@ FROM nephatrine/nxbuilder:golang AS builder
|
|||
|
||||
ARG DRONE_VERSION=v2.16.0
|
||||
ARG DRONE_CLI_VERSION=v1.7.0
|
||||
ARG DRONE_DOCKER_VERSION=v1.8.3
|
||||
ARG DRONE_EXEC_VERSION=v1.0.0-beta.10
|
||||
ARG DRONE_SSH_VERSION=v1.0.1
|
||||
|
||||
RUN git -C /root clone -b "$DRONE_VERSION" --single-branch --depth=1 https://github.com/harness/drone
|
||||
RUN git -C /root clone -b "$DRONE_CLI_VERSION" --single-branch --depth=1 https://github.com/harness/drone-cli
|
||||
RUN git -C /root clone -b "$DRONE_DOCKER_VERSION" --single-branch --depth=1 https://github.com/drone-runners/drone-runner-docker
|
||||
RUN git -C /root clone -b "$DRONE_EXEC_VERSION" --single-branch --depth=1 https://github.com/drone-runners/drone-runner-exec
|
||||
RUN git -C /root clone -b "$DRONE_SSH_VERSION" --single-branch --depth=1 https://github.com/drone-runners/drone-runner-ssh
|
||||
|
||||
RUN echo "====== COMPILE DRONE ======" \
|
||||
&& cd /root/drone \
|
||||
|
@ -19,20 +15,16 @@ RUN echo "====== COMPILE DRONE-CLI ======" \
|
|||
&& cd /root/drone-cli \
|
||||
&& go install ./...
|
||||
RUN echo "====== COMPILE DRONE-RUNNERS ======" \
|
||||
&& cd /root/drone-runner-docker && go build -o /go/bin/drone-runner-docker \
|
||||
&& cd /root/drone-runner-exec && go build -o /go/bin/drone-runner-exec \
|
||||
&& cd /root/drone-runner-ssh && go build -o /go/bin/drone-runner-ssh
|
||||
&& cd /root/drone-runner-exec && go build -o /go/bin/drone-runner-exec
|
||||
|
||||
FROM nephatrine/alpine-s6:latest
|
||||
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
|
||||
|
||||
RUN echo "====== INSTALL PACKAGES ======" \
|
||||
&& apk add --no-cache docker git git-lfs sqlite
|
||||
&& apk add --no-cache git git-lfs sqlite
|
||||
|
||||
COPY --from=builder \
|
||||
/go/bin/drone-runner-docker \
|
||||
/go/bin/drone-runner-exec \
|
||||
/go/bin/drone-runner-ssh \
|
||||
/go/bin/drone-server \
|
||||
/go/bin/drone /usr/bin/
|
||||
COPY override /
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Copyright © 2021 Daniel Wolf <<nephatrine@gmail.com>>
|
||||
Copyright © 2023 Daniel Wolf <<nephatrine@gmail.com>>
|
||||
|
||||
**Permission to use, copy, modify, and distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
19
README.md
19
README.md
|
@ -16,24 +16,21 @@ AND USE REQUIRES YOU MEET CERTAIN REQUIREMENTS AS LAID OUT IN THE
|
|||
IF YOU DO NOT MEET THOSE REQUIREMENTS YOU MUST EITHER USE THE COMMUNITY VERSION
|
||||
INSTEAD OR PURCHASE A LICENSE.**
|
||||
|
||||
**YOU WILL NEED TO USE A SEPARATE REVERSE PROXY SERVER TO SECURE THIS SERVICE.
|
||||
FOR INSTANCE, AN [NGINX](https://nginx.com/) REVERSE PROXY CONTAINER.**
|
||||
To secure this service, we suggest a separate reverse proxy server, such as an
|
||||
[NGINX](https://nginx.com/) container.
|
||||
|
||||
- [Alpine Linux](https://alpinelinux.org/)
|
||||
- [Skarnet Software](https://skarnet.org/software/)
|
||||
- [S6 Overlay](https://github.com/just-containers/s6-overlay)
|
||||
- [Drone](https://drone.io/)
|
||||
- [SQLite](https://www.sqlite.org/)
|
||||
- [Alpine Linux](https://alpinelinux.org/) w/ [S6 Overlay](https://github.com/just-containers/s6-overlay)
|
||||
- [Drone](https://drone.io/) w/ [SQLite](https://www.sqlite.org/)
|
||||
|
||||
This container includes a server, docker runner, and exec runner. This is not a
|
||||
This container only includes a server and exec runner. This is not a
|
||||
single-server configuration so you can easily add more agents and runners in
|
||||
separate containers as needed. You can pass variable ``DRONE_DOCKER_DISABLED``
|
||||
or ``DRONE_EXEC_DISABLED`` to disable one or both runners.
|
||||
separate containers as needed. You can pass variable ``DRONE_EXEC_DISABLED``
|
||||
to disable the included runner.
|
||||
|
||||
You can spin up a quick temporary test container like this:
|
||||
|
||||
~~~
|
||||
docker run --rm -p 8080:8080 -v /var/run/docker.sock:/run/docker.sock -it nephatrine/drone-ci:latest /bin/bash
|
||||
docker run --rm -p 8080:8080 -it nephatrine/drone-ci:latest /bin/bash
|
||||
~~~
|
||||
|
||||
## Docker Tags
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
/mnt/config/log/drone-docker-runner.log {
|
||||
missingok
|
||||
notifempty
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
/mnt/config/log/drone-ssh-runner.log {
|
||||
missingok
|
||||
notifempty
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
#!/command/with-contenv /bin/bash
|
||||
|
||||
export HOME=/mnt/config/home
|
||||
cd /mnt/config/home
|
||||
|
||||
while /usr/bin/pgrep drone-server >/dev/null; do
|
||||
sleep 5
|
||||
done
|
||||
|
||||
# Create Log Directory
|
||||
|
||||
if [[ ! -d /mnt/config/log ]]; then
|
||||
/command/s6-setuidgid guardian /bin/mkdir -p /mnt/config/log
|
||||
fi
|
||||
|
||||
# Start Runner
|
||||
|
||||
if [[ -f /mnt/config/etc/drone-config ]]; then
|
||||
. /mnt/config/etc/drone-config
|
||||
fi
|
||||
export DRONE_LOG_FILE=${DRONE_LOG_FILE:-"/mnt/config/log/drone-docker-runner.log"}
|
||||
export DRONE_RPC_PROTO=${DRONE_RPC_PROTO:-"${DRONE_SERVER_PROTO}"}
|
||||
export DRONE_RPC_HOST=${DRONE_RPC_HOST:-"${DRONE_SERVER_HOST}"}
|
||||
export DRONE_RUNNER_OS=${DRONE_RUNNER_OS:-"linux"}
|
||||
export DRONE_RUNNER_ARCH=${DRONE_RUNNER_ARCH:-"amd64"}
|
||||
export DRONE_RUNNER_NAME="$(hostname)-docker"}
|
||||
|
||||
if [[ ! -z "${DRONE_RPC_SECRET}" && ! -z "${DRONE_RPC_HOST}" && -z "${DRONE_AGENT_DISABLED}" && -z "${DRONE_DOCKER_DISABLED}" ]]; then
|
||||
exec /command/s6-setuidgid guardian /usr/bin/drone-runner-docker
|
||||
else
|
||||
sleep 300
|
||||
exit 0
|
||||
fi
|
|
@ -1 +0,0 @@
|
|||
longrun
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
#!/command/with-contenv /bin/bash
|
||||
|
||||
export HOME=/mnt/config/home
|
||||
cd /mnt/config/home
|
||||
|
||||
while /usr/bin/pgrep drone-server >/dev/null; do
|
||||
sleep 5
|
||||
done
|
||||
|
||||
# Create Log Directory
|
||||
|
||||
if [[ ! -d /mnt/config/log ]]; then
|
||||
/command/s6-setuidgid guardian /bin/mkdir -p /mnt/config/log
|
||||
fi
|
||||
|
||||
# Start Runner
|
||||
|
||||
if [[ -f /mnt/config/etc/drone-config ]]; then
|
||||
. /mnt/config/etc/drone-config
|
||||
fi
|
||||
export DRONE_LOG_FILE=${DRONE_LOG_FILE:-"/mnt/config/log/drone-ssh-runner.log"}
|
||||
export DRONE_RPC_PROTO=${DRONE_RPC_PROTO:-"${DRONE_SERVER_PROTO}"}
|
||||
export DRONE_RPC_HOST=${DRONE_RPC_HOST:-"${DRONE_SERVER_HOST}"}
|
||||
export DRONE_RUNNER_OS=${DRONE_RUNNER_OS:-"linux"}
|
||||
export DRONE_RUNNER_ARCH=${DRONE_RUNNER_ARCH:-"amd64"}
|
||||
export DRONE_RUNNER_NAME="$(hostname)-ssh"}
|
||||
|
||||
if [[ ! -z "${DRONE_RPC_SECRET}" && ! -z "${DRONE_RPC_HOST}" && -z "${DRONE_AGENT_DISABLED}" && -z "${DRONE_SSH_DISABLED}" ]]; then
|
||||
exec /command/s6-setuidgid guardian /usr/bin/drone-runner-ssh
|
||||
else
|
||||
sleep 300
|
||||
exit 0
|
||||
fi
|
|
@ -1 +0,0 @@
|
|||
longrun
|
|
@ -3,35 +3,17 @@
|
|||
export HOME=/mnt/config/home
|
||||
cd /mnt/config/home
|
||||
|
||||
# Configure Docker Group
|
||||
|
||||
if [[ -e /run/docker.sock ]]; then
|
||||
DGID=`/bin/stat /run/docker.sock | /usr/bin/tr -d '/' | /bin/grep Gid | /usr/bin/awk '{print $(NF-1)}'`
|
||||
if [[ ! -z "${DGID}" ]]; then
|
||||
/usr/sbin/groupmod -o -g "$DGID" docker
|
||||
/usr/sbin/usermod -a -G docker guardian
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create Drone Database Directory
|
||||
|
||||
if [[ ! -d /mnt/config/data ]]; then
|
||||
/command/s6-setuidgid guardian /bin/mkdir -p /mnt/config/data
|
||||
fi
|
||||
if [[ -f /mnt/config/data/drone/db/drone.db && ! -f /mnt/config/data/drone.sqlite ]]; then
|
||||
# Migrate Old Location
|
||||
/command/s6-setuidgid guardian /bin/mv /mnt/config/data/drone/db/drone.db /mnt/config/data/drone.sqlite
|
||||
fi
|
||||
|
||||
# Build Drone Configuration
|
||||
|
||||
if [[ ! -d /mnt/config/etc ]]; then
|
||||
/command/s6-setuidgid guardian /bin/mkdir -p /mnt/config/etc
|
||||
fi
|
||||
if [[ -f /mnt/config/etc/drone/config && ! -f /mnt/config/etc/drone-config ]]; then
|
||||
# Migrate Old Location
|
||||
/command/s6-setuidgid guardian /bin/mv /mnt/config/etc/drone/config /mnt/config/etc/drone-config
|
||||
fi
|
||||
if [[ ! -f /mnt/config/etc/drone-config ]]; then
|
||||
/command/s6-setuidgid guardian /bin/touch /mnt/config/etc/drone-config
|
||||
|
||||
|
|
Reference in New Issue