Merge pull request 'feature/drone-1.9.1' (#49) from feature/drone-1.9.1 into master

Reviewed-on: #49
This commit is contained in:
Manuel Friedli 2020-09-25 23:47:54 +02:00
commit f967279d93
6 changed files with 154 additions and 1 deletions

View file

@ -1,3 +1,13 @@
25 Sep 2020; Manuel Friedli <manuel@gentoo.org> drone-1.9.1.ebuild,
files/drone.sh:
dev-util/drone: Handle all variables in config file generically.
*drone-1.9.1 (25 Sep 2020)
25 Sep 2020; Manuel Friedli <manuel@gentoo.org> +drone-1.9.1.ebuild,
+files/app.ini, +files/drone.service, +files/drone.sh:
dev-util/drone: Add ebuild for drone 1.9.1; targeted at systemd.
*drone-1.5.1 (01 Oct 2019)
01 Oct 2019; <manuel@gentoo.org> +drone-1.5.1.ebuild,

View file

@ -1,8 +1,12 @@
AUX app.ini 1447 BLAKE2B 24e525c2863dd72bbca507ba18fa2d5df67923ca3d2ecb20023d8ecac6fecf0abc9008353b8b659c912d35bb6248413229449512b2fcf7a5fa969f5cde872130 SHA512 b1856df8a8c1501be8196e7a0f0f821617dfe0f20ab1c436438d5874984772af57dd4d3a6e58df684ade9d73462670287409b56e47d8148a7fdb454a95d82ef7
AUX drone-1.2.3.confd 1272 BLAKE2B 9722097b271e1b688559d2fbcd0e91decc03deaf868e91c62fe26c88b4f72806fc0fd628f4b47750ff707904bd88c5223ae58f0360a1c563ffe7bb11e08446fc SHA512 3960d26f6fa41eb3c6e9ccc719ac6c6ff7508f72c82507b2b2d5a6e7b88ce894933ee24ea73f2bc3c1a4460d12db78877805369def378f7d1d499c498a7a4f50
AUX drone-1.2.3.initd 1893 BLAKE2B 341983efd9f7e40f702d78782f9d0bc29ca4e919057dde742a4d49291fea61af82b0e474232f83b361894925608919674c7620447743e7b1c4b4bca70db52997 SHA512 887984ae903f2b162cb43b8fb5b5019f742a1891208a3f3f54ef6681a32aa279bcf4b9c758dc7652abbfd245bc2af38c0c199ff90b4a88c6bc00d55942592df2
AUX drone-1.5.1.confd 1272 BLAKE2B 9722097b271e1b688559d2fbcd0e91decc03deaf868e91c62fe26c88b4f72806fc0fd628f4b47750ff707904bd88c5223ae58f0360a1c563ffe7bb11e08446fc SHA512 3960d26f6fa41eb3c6e9ccc719ac6c6ff7508f72c82507b2b2d5a6e7b88ce894933ee24ea73f2bc3c1a4460d12db78877805369def378f7d1d499c498a7a4f50
AUX drone-1.5.1.initd 1851 BLAKE2B b7b865575537f2c867140451301e7eccf9a49b28025d4e64c22a1d3c121db0438702a5541782355722523cd21dbcb02d464a1d85c0bb48c32b10343be8095977 SHA512 203ddc0bbc7538d1ece8c1db61808b41f86bef338aad49ffaa9d385a85f5c1c5c48cae3a9be0c5b48ddea1ff30e96ec0dca25de66b2359ec0d246eb7f274a8b1
AUX drone.service 651 BLAKE2B 8c2a44a0a19190e53bc5c3b3a15d827af42b7e4f19931e9553552c6e4be91fe35c61836e51627b2c03effbcd0f2eecc585c341ea7f12be309f6b98a041ac4764 SHA512 15a3a5b0f02cf6da5b83c2417d8718e3bc388a22c46924d08c6df70d945344384b4dcaf87fc0655e6f6ebbf9a3b20790722579e29a9ef7ff515c5857ef5b3cdb
AUX drone.sh 511 BLAKE2B dee9cb484102f92ad1eec6c63e8a008aa7fb11dbf3594bf8d281fae052f822606c2980c82ad5ff033124f7c6d92c92a16ff895ca371326bc85f33325a9f27916 SHA512 6874cbb4ab3972f8f791d419ad57832187d739da6e11eda81a06273d8235502a03761a7b3ba1aed09689c95e5f1a53826a0dd154c85e3a96dc21cb59b4745740
EBUILD drone-1.2.3.ebuild 523 BLAKE2B 20ec727b9488eab0e2c9c7eabc6845ec9705ad3bdfb70803cefc52a4e85ca87f81d9089272c60e3ace8860eb5260e6348aae9f8b719c478e69dca8207d8323bc SHA512 b3ba803d16f6cc8acffcd19c96c993f502551ff0388bf0e5dc6b8c87f7a9389e3da5390de0ec326db617aea96344a46fcb7095bac17280185b61cce06bc6905f
EBUILD drone-1.5.1.ebuild 523 BLAKE2B 20ec727b9488eab0e2c9c7eabc6845ec9705ad3bdfb70803cefc52a4e85ca87f81d9089272c60e3ace8860eb5260e6348aae9f8b719c478e69dca8207d8323bc SHA512 b3ba803d16f6cc8acffcd19c96c993f502551ff0388bf0e5dc6b8c87f7a9389e3da5390de0ec326db617aea96344a46fcb7095bac17280185b61cce06bc6905f
MISC ChangeLog 801 BLAKE2B ded57c32d329ef697498e87e1409dd1af7fae906b1bd63821c39054edc9fc8f13eac015e680177f515a4ae976dd637b54f38952d166194233ff06b9fdc9a9a82 SHA512 deaaf36e118f94bb544e0ad92dd137a59d3656ac90dc7499ec5df98d5ccd6e52c3dd974ea8f622a9624197d075e3c726e04ccbb7075241da9c97d43bfaabdf3e
EBUILD drone-1.9.1.ebuild 839 BLAKE2B e6819be8b37ee37213f718dae0cbf479ced61927048f44a2f24f2c8c82646cbeab4e9ae69bffe9ff07810adc75ef26ae521e084ce8754d38d693d8fbd9fe5a84 SHA512 ae132e180e0d3f86468e6de16dfaeb6a2a24f8ed98fce56ec7d01d11b720d500a30fed79bd1282d90058c1b1a3346c61a0a97e8214101156b44b099e292f2e17
MISC ChangeLog 1181 BLAKE2B 859c5070401bb193f10a9ab9cbcba93994a61ed0897c0d1416b15605ff4f8a879630a0909f90fb16dcab472ffe9c3ef206f275aad31bcdfd5335090ddd5a3c2e SHA512 b36d542bae9266e7f749e41faf6e6c7ccc5a960bb0c67a8153645ae34f87a80fefce5141e7efc9d5e9e3ddb879543037af96359f0784b7f15ab9b28424e8ddc1
MISC metadata.xml 248 BLAKE2B cb50cad2c614a99daa2e236f9e0d0fab1ab20a898c0b0f0c28a1387820ab1f2b9dd4d396a3b38f732b493824f96a29ee5894e80e09dbd08dff62c1aaba3feaa0 SHA512 29f9b96b0a77546cce6a8bffd82fae2fd0939d32a7a05ffd0d91f9250a019a3ddaa599b93988c82daabb9c4c4b284dd947e2c47f6ca7727b8539cffa91bcb8c2

View file

@ -0,0 +1,46 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
inherit systemd
DESCRIPTION="Drone CI - Automate Software Testing and Delivery"
HOMEPAGE="https://drone.io/"
#SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="sqlite mysql"
RESTRICT="mirror"
DEPEND=""
RDEPEND="acct-user/drone
app-emulation/docker
sqlite? ( dev-db/sqlite:3 )
mysql? ( dev-db/mysql )
"
S="${WORKDIR}"
src_prepare() {
sed -e "s/<VERSION>/${PV}/g" "${FILESDIR}/drone.sh" > "${T}/drone.sh"
eapply_user
}
src_install() {
exeinto /usr/bin
doexe "${T}/drone.sh"
systemd_dounit "${FILESDIR}/${PN}.service"
insinto "/etc/drone"
doins "${FILESDIR}/app.ini"
fowners drone:drone /etc/drone
fperms 0700 /etc/drone
fowners drone:drone /etc/drone/app.ini
fperms 0600 /etc/drone/app.ini
}

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

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

@ -0,0 +1,27 @@
#!/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}"
docker_args=""
for var in "${!DRONE_@}" ; do
docker_args="${docker_args} --env=${var}=${!var} "
done
for p in ${DOCKER_PUBLISH} ; do
docker_args="${docker_args} --publish=${p}"
done
docker run \
--volume=/var/lib/drone:/data \
${docker_args}
--restart=always \
--detach=true \
--name=drone \
drone/drone:<VERSION>