1
0
Fork 0

add optional config file to set envvars
Build Container Image / buildamd64 (push) Successful in 20s Details
Build Container Image / packageamd64 (push) Successful in 12s Details
Build Container Image / publishamd64 (push) Successful in 25s Details
Build Container Image / buildarm64 (push) Successful in 7s Details
Build Container Image / packagearm64 (push) Successful in 6s Details
Build Container Image / publisharm64 (push) Successful in 8s Details
Build Container Image / manifestpkg (push) Successful in 12s Details
Build Container Image / manifesthub (push) Successful in 16s Details

This commit is contained in:
Daniel Wolf 2023-04-22 10:35:53 -04:00
parent f76af3c061
commit 1c655e282f
Signed by: nephatrine
GPG Key ID: 59D70EC2E4AAB4D0
3 changed files with 28 additions and 3 deletions

View File

@ -15,3 +15,5 @@ RUN echo "====== INSTALL PACKAGES ======" \
COPY --from=builder /go/bin/drone-runner-docker /usr/bin/
COPY override /
EXPOSE 3000/tcp

View File

@ -55,6 +55,7 @@ You can perform some basic configuration of the container using the files and
directories listed below.
- ``/mnt/config/etc/crontabs/<user>``: User Crontabs. [*]
- ``/mnt/config/etc/drone-runner-config``: Set Drone Envars. [*]
- ``/mnt/config/etc/logrotate.conf``: Logrotate Global Configuration.
- ``/mnt/config/etc/logrotate.d/``: Logrotate Additional Configuration.

View File

@ -9,14 +9,36 @@ if [[ ! -d /mnt/config/log ]]; then
/command/s6-setuidgid guardian /bin/mkdir -p /mnt/config/log
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-runner-config ]]; then
/command/s6-setuidgid guardian /bin/touch /mnt/config/etc/drone-runner-config
echo "#export DRONE_RPC_SECRET=" >> /mnt/config/etc/drone-runner-config
echo "#export DRONE_RPC_PROTO=http" >> /mnt/config/etc/drone-runner-config
echo "#export DRONE_RPC_HOST=example.net" >> /mnt/config/etc/drone-runner-config
echo "#export DRONE_RUNNER_NAME=$(hostname)" >> /mnt/config/etc/drone-runner-config
echo "#export DRONE_RUNNER_CAPACITY=1" >> /mnt/config/etc/drone-runner-config
fi
# Start Runner
. /mnt/config/etc/drone-runner-config
export DRONE_LOG_FILE=${DRONE_LOG_FILE:-"/mnt/config/log/drone-docker-runner.log"}
export DRONE_RPC_PROTO=${DRONE_RPC_PROTO:-"http"}
#export DRONE_RUNNER_OS=${DRONE_RUNNER_OS:-"linux"}
#export DRONE_RUNNER_ARCH=${DRONE_RUNNER_ARCH:-"amd64"}
export DRONE_RUNNER_NAME=${DRONE_RPC_PROTO:-"$(hostname)"}
export DRONE_RUNNER_NAME=${DRONE_RUNNER_NAME:-"$(hostname)"}
export DRONE_RUNNER_CAPACITY=${DRONE_RUNNER_CAPACITY:-1}
export DRONE_RUNNER_OS=${DRONE_RUNNER_OS:-"linux"}
if [[ "$(uname -m)" == "aarch64" ]]; then
export DRONE_RUNNER_ARCH=${DRONE_RUNNER_ARCH:-"arm64"}
else
export DRONE_RUNNER_ARCH=${DRONE_RUNNER_ARCH:-"amd64"}
fi
# Fix Log Perms
if [[ ! -f "${DRONE_LOG_FILE}" ]]; then
/command/s6-setuidgid guardian /bin/touch "${DRONE_LOG_FILE}"