dev-util/drone: Add ebuild for drone 1.9.1; targeted at systemd.

Package-Manager: Portage-3.0.4, Repoman-3.0.1
This commit is contained in:
Manuel Friedli 2020-09-25 23:17:11 +02:00
parent 7a64c3f223
commit 86739ddf2f
6 changed files with 149 additions and 1 deletions

View file

@ -0,0 +1,34 @@
# Drone configuration file. See https://docs.drone.io/server/reference/ for a
# complete list of configuration options.
# Required string value provides your Gitea oauth Client ID.
DRONE_GITEA_CLIENT_ID="your-id-goes-here"
# Required string value provides your Gitea oauth Client Secret.
DRONE_GITEA_CLIENT_SECRET="your-secret-goes-here"
# Required string value provides your Gitea server address. For example
# https://gitea.company.com
DRONE_GITEA_SERVER="https://gitea-server.example.com/"
# Required string value provides the shared secret generated in the previous
# step. This is used to authenticate the rpc connection between the server and
# runners. The server and runner must be provided the same secret value.
DRONE_RPC_SECRET="your-rpc-secret-goes-here"
# Required string value provides your external hostname or IP address. If using
# an IP address you may include the port. For example drone.company.com.
DRONE_SERVER_HOST="drone-ci.example.com"
# Required string value provides your external protocol scheme. This value
# should be set to http or https. This field defaults to https if you configure
# ssl or acme.
DRONE_SERVER_PROTO="https"
# Optional boolean value configures Drone to authenticate when cloning public
# repositories.
# DRONE_GIT_ALWAYS_AUTH=true
# Required string value configures ports to publish for docker: space-separated
# list of <hostport>:<containerport> tuples
DOCKER_PUBLISH="8080:80 8443:443"

View file

@ -0,0 +1,32 @@
[Unit]
Description=drone.io build server
Documentation=https://docs.drone.io/
AssertPathIsDirectory=/var/lib/drone
AssertPathIsReadWrite=/var/lib/drone
After=network.target
Requires=network.target
After=mysqld.target
After=postgresql-9.3.service
After=postgresql-9.4.service
After=postgresql-9.5.service
After=postgresql-9.6.service
After=postgresql-10.service
After=postgresql-11.service
After=postgresql-12.service
[Service]
User=drone
Group=drone
Environment="DRONE_CONFIG_FILE=/etc/drone/app.ini"
ExecStart=drone.sh
ExecStop=docker container stop drone
ExecStop=docker container rm drone
Restart=always
[Install]
WantedBy=multi-user.target

29
dev-util/drone/files/drone.sh Executable file
View file

@ -0,0 +1,29 @@
#!/bin/sh
# $DRONE_CONFIG_FILE contains path to the config file
if [[ -z "${DRONE_CONFIG_FILE}" ]] ; then
echo "DRONE_CONFIG_FILE not set!"
exit 1
fi
. "${DRONE_CONFIG_FILE}"
publishes=""
for p in ${DOCKER_PUBLISH} ; do
publishes="${publishes} --publish=${p}"
done
docker run \
--volume=/var/lib/drone:/data \
--env=DRONE_GITEA_SERVER=${DRONE_GITEA_SERVER} \
--env=DRONE_GITEA_CLIENT_ID=${DRONE_GITEA_CLIENT_ID} \
--env=DRONE_GITEA_CLIENT_SECRET=${DRONE_GITEA_CLIENT_SECRET} \
--env=DRONE_RPC_SECRET=${DRONE_RPC_SECRET} \
--env=DRONE_SERVER_HOST=${DRONE_SERVER_HOST} \
--env=DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO} \
${publishes} \
--restart=always \
--detach=true \
--name=drone \
drone/drone:<VERSION>