dev-util/drone: Add ebuild for version 1.1.0
Package-Manager: Portage-2.3.62, Repoman-2.3.11
This commit is contained in:
parent
12df30c63a
commit
27a8b4848a
6 changed files with 145 additions and 0 deletions
39
dev-util/drone/files/drone-1.1.0.confd
Executable file
39
dev-util/drone/files/drone-1.1.0.confd
Executable file
|
@ -0,0 +1,39 @@
|
|||
# set this to the full hostname (including scheme) of your Gitea instance
|
||||
DRONE_GITEA_SERVER=http://gitea.example.com/
|
||||
|
||||
# set this to the bare hostname of your Drone instance
|
||||
DRONE_SERVER_HOST=drone.example.com
|
||||
|
||||
# set this to http or https, depending whether you intend to serve Drone over SSL or not
|
||||
DRONE_SERVER_PROTO=https
|
||||
|
||||
# These values are obtained when registering Drone as an OAuth2 application in your Gitea instance
|
||||
DRONE_GITEA_CLIENT_ID=
|
||||
DRONE_GITEA_CLIENT_SECRET=
|
||||
|
||||
# The path to the docker socket
|
||||
DOCKER_SOCKET=/var/run/docker.sock
|
||||
|
||||
# The path to the MySQL socket
|
||||
# FIXME this must be done better, in a more generic way
|
||||
MYSQL_SOCKET=/var/run/mysqld/mysqld.sock
|
||||
|
||||
# The full datasource path to your Drone database
|
||||
DRONE_DATABASE_DATASOURCE=/data/drone.sqlite
|
||||
|
||||
# The database driver Drone should use (sqlite, mysql, ...)
|
||||
DRONE_DATABASE_DRIVER=sqlite
|
||||
|
||||
# Number of agents that should be started concurrently on your Drone instance
|
||||
DRONE_RUNNER_CAPACITY=2
|
||||
|
||||
# If logging in doesn't work, try setting this to true
|
||||
DRONE_GIT_ALWAYS_AUTH=false
|
||||
|
||||
# Leave this false if you don't intend to use ACME/Letsencrypt
|
||||
# FIXME really??
|
||||
DRONE_TLS_AUTOCERT=false
|
||||
|
||||
# What port to public from your container. Format:
|
||||
# <hostport>:<containerport>, e.g. 8080:80
|
||||
DRONE_PUBLISH_PORT=80:80
|
62
dev-util/drone/files/drone-1.1.0.initd
Executable file
62
dev-util/drone/files/drone-1.1.0.initd
Executable file
|
@ -0,0 +1,62 @@
|
|||
#!/sbin/openrc-run
|
||||
# Copyright 2016-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
description="Drone CI - Automate software testing and delivery"
|
||||
|
||||
container_name_file=/var/run/drone-container.name
|
||||
|
||||
: ${DRONE_GITEA_SERVER:=http://localhost/
|
||||
: ${DRONE_SERVER_HOST:=localhost}
|
||||
: ${DRONE_SERVER_PROTO:=https}
|
||||
: ${DRONE_GITEA_CLIENT_ID:=}
|
||||
: ${DRONE_GITEA_CLIENT_SECRET:=}
|
||||
: ${DOCKER_SOCKET:=/var/run/docker.sock}
|
||||
# fixme this must be done better, in a more generic way
|
||||
: ${MYSQL_SOCKET:=/var/run/mysqld/mysqld.sock}
|
||||
: ${DRONE_DATABASE_DATASOURCE:=/data/drone.sqlite}
|
||||
: ${DRONE_DATABASE_DRIVER:=sqlite}
|
||||
: ${DRONE_RUNNER_CAPACITY:=2}
|
||||
: ${DRONE_GIT_ALWAYS_AUTH:=false}
|
||||
: ${DRONE_TLS_AUTOCERT:=false}
|
||||
: ${DRONE_PUBLISH_PORT:=80:80}
|
||||
|
||||
depend() {
|
||||
need docker
|
||||
after mysql
|
||||
}
|
||||
|
||||
pre_start() {
|
||||
docker pull drone/drone:1.1.0
|
||||
}
|
||||
|
||||
start() {
|
||||
docker run \
|
||||
--volume=${DOCKER_SOCKET}:${DOCKER_SOCKET} \
|
||||
--volume=${MYSQL_SOCKET}:${MYSQL_SOCKET} \
|
||||
--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_GIT_ALWAYS_AUTH=${DRONE_GIT_ALWAYS_AUTH} \
|
||||
--env=DRONE_RUNNER_CAPACITY=${DRONE_RUNNER_CAPACITY} \
|
||||
--env=DRONE_SERVER_HOST=${DRONE_SERVER_HOST} \
|
||||
--env=DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO} \
|
||||
--env=DRONE_TLS_AUTOCERT=${DRONE_TLS_AUTOCERT} \
|
||||
--env=DRONE_DATABASE_DATASOURCE="${DRONE_DATABASE_DATASOURCE}" \
|
||||
--env=DRONE_DATABASE_DRIVER=${DRONE_DATABASE_DRIVER} \
|
||||
--publish=${DRONE_PUBLISH_PORT} \
|
||||
--restart=always \
|
||||
--detach=true \
|
||||
--name=drone \
|
||||
drone/drone:1.1.0 \
|
||||
> ${container_name_file}
|
||||
}
|
||||
|
||||
stop() {
|
||||
docker container stop $(cat ${container_name_file})
|
||||
}
|
||||
|
||||
stop_post() {
|
||||
docker container rm $(cat ${container_name_file})
|
||||
rm ${container_name_file}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue