dev-util/drone: Ebuild tuning, added ose USE flag, stripped binary, clean default config
This commit is contained in:
parent
308e324dfb
commit
fec37c29f6
@ -1,5 +1,5 @@
|
|||||||
AUX drone-server.confd 1427 BLAKE2B 1bd764c340bcf5f5ecb2a4322d6d9440b86e4a881d5d0db01d479103ad50b2035d5bf3c725615be190dfbef5d872aa60c2efd14dbd4bab086246522508fc41a7 SHA512 0d64832e5edcd89dfd8489cd290a14f2e3b379823c04aeef42a3a283236bb53f32c3305bf163d0e9d1cc1cd572b3d55010c2c9fc934641eea9b1fadfb5314f41
|
AUX drone-server.confd 231 BLAKE2B 18007a790857d1f7267a293379971e9101647e4d9d2101e25289184b5d116dc7a61f3abde6f3206e086521484abbdbfc71dd9dd3c6ed2dd93ed813baacbdb2a0 SHA512 6effc899b8ce9dbcc8a0a06cfe3e96011e98d18daf65823cdbb70d0017e4a58fd9f64c4e70132d7ed945b07c71a410733d55caa1779af4915707b56febc08b98
|
||||||
AUX drone-server.initd 563 BLAKE2B 0f4fb9c7740f04a1e4c764b4f5af8d178d320b8a94fd949359183cad5768cc5b7ebf241fd323cd2ff14ea5d0287ff2cd190383803622e99af9403f508293f457 SHA512 5153e4453dd96c89940bbdb657bf96152818c761e2ad5fc566a4f238f6b698485351e817b8d7626fd0a4bf62f4e082189e4fbc30a1bf75147fcfe7290c23d099
|
AUX drone-server.initd 559 BLAKE2B 36e3039c53d9060632233f12846bbf5a116c5c8f488669ef86db5ff0103fc249b2f84ab73638b2ee3dc44537dbee711ac546dce959ad93b63bd5459ab9ff40d9 SHA512 16af47539bf49a2cfb1a1a506412d331a25b8737b7775d74cc075ec2803cdc7cdd2cdc6c35f695f5c483ac15595eec164f1a1883e570a41e4db0a7ece4ffbd59
|
||||||
DIST drone-1.1.0.tar.gz 1243326 BLAKE2B f2f72cd7072bdd8705a9687c74758e13f4c9e8b010069c5c835596d590b86a1ecaa92f63e430bde807b1e58742a91df8c7730d0292e456a549ba474328e9edd8 SHA512 403d417627bda6e1dc3df94b5d4609f8d2541e11a62cc654fb01b65984c86dc10f542d22d06ada7eec32befd67e9932946224c6e8303d2ce11546d77478480f1
|
DIST drone-1.1.0.tar.gz 1243326 BLAKE2B f2f72cd7072bdd8705a9687c74758e13f4c9e8b010069c5c835596d590b86a1ecaa92f63e430bde807b1e58742a91df8c7730d0292e456a549ba474328e9edd8 SHA512 403d417627bda6e1dc3df94b5d4609f8d2541e11a62cc654fb01b65984c86dc10f542d22d06ada7eec32befd67e9932946224c6e8303d2ce11546d77478480f1
|
||||||
DIST github.com-99designs-httpsignatures-go-88528bf4ca7e.tar.gz 4883 BLAKE2B ffb718ff3ca6ea55fd34d8c2000d186731c14fcfb96607350e52182ab185f62e6a30f5bef12ecdecceb92e0be25646e1531105cf31039aabc5fb25c42131cced SHA512 64614d307c1ce3ea001741b6736672d33c98c76a013547bbbcc19ec057d91446e3752f603229185b45c7266cbe0df194d2c593ad8052fc77a91288aa295c71ba
|
DIST github.com-99designs-httpsignatures-go-88528bf4ca7e.tar.gz 4883 BLAKE2B ffb718ff3ca6ea55fd34d8c2000d186731c14fcfb96607350e52182ab185f62e6a30f5bef12ecdecceb92e0be25646e1531105cf31039aabc5fb25c42131cced SHA512 64614d307c1ce3ea001741b6736672d33c98c76a013547bbbcc19ec057d91446e3752f603229185b45c7266cbe0df194d2c593ad8052fc77a91288aa295c71ba
|
||||||
DIST github.com-Microsoft-go-winio-v0.4.11.tar.gz 79254 BLAKE2B 14f38a2821817d43e9b8d5b51b44c13b1252e7182c455d6b3a35549b5cb0095d7c8c9a49baa5d34fdd9ba84265299894de9b875a1081399692a72920db608414 SHA512 0fecac75a971deba7b2957ef53e772d1eb153f9a920d0d9db7491927fe84aa6021ebf87380a4c170c8361dcb84d4e2db0c142c2b76c7908dbb12645f3eb7ff9e
|
DIST github.com-Microsoft-go-winio-v0.4.11.tar.gz 79254 BLAKE2B 14f38a2821817d43e9b8d5b51b44c13b1252e7182c455d6b3a35549b5cb0095d7c8c9a49baa5d34fdd9ba84265299894de9b875a1081399692a72920db608414 SHA512 0fecac75a971deba7b2957ef53e772d1eb153f9a920d0d9db7491927fe84aa6021ebf87380a4c170c8361dcb84d4e2db0c142c2b76c7908dbb12645f3eb7ff9e
|
||||||
@ -96,4 +96,4 @@ DIST github.com-segmentio-ksuid-v1.0.2.tar.gz 17719 BLAKE2B ed549bcaac74f41ea5e6
|
|||||||
DIST github.com-sirupsen-logrus-44067abb194b.tar.gz 37861 BLAKE2B 0d11ff1acb0751d1e30a614ad7ef745a46095ca139e957d92350e9552e884df26d88bf55ba3602c8619e3231f6e9830617218ed8e85f1a7045bf704a8c74eaae SHA512 d8276f479b3d67153789888ba82b615cd2f47bf6ea4a2d777dccf4869501d82e7da4e74152aae2fa4b04ee7bd9e842472e3ab735bd88f0e33dab3bc9e9b61762
|
DIST github.com-sirupsen-logrus-44067abb194b.tar.gz 37861 BLAKE2B 0d11ff1acb0751d1e30a614ad7ef745a46095ca139e957d92350e9552e884df26d88bf55ba3602c8619e3231f6e9830617218ed8e85f1a7045bf704a8c74eaae SHA512 d8276f479b3d67153789888ba82b615cd2f47bf6ea4a2d777dccf4869501d82e7da4e74152aae2fa4b04ee7bd9e842472e3ab735bd88f0e33dab3bc9e9b61762
|
||||||
DIST github.com-spf13-pflag-v1.0.3.tar.gz 46002 BLAKE2B b7caa90be69c7bb6a36b0da68af309debee6edd6e2596d39e286ebdb10f9f90246736f3af3a35c89ac704e2764d2ac40e76dad09c3147a942200592e3d234916 SHA512 d7121dade4fc06568cfb650a529dda350c60171e97ca405d29b9654a9fd06e453d20f8efc2fd8c51f530cfb0708648b2b2ba06ab40897b262ef2f3baf04d65a7
|
DIST github.com-spf13-pflag-v1.0.3.tar.gz 46002 BLAKE2B b7caa90be69c7bb6a36b0da68af309debee6edd6e2596d39e286ebdb10f9f90246736f3af3a35c89ac704e2764d2ac40e76dad09c3147a942200592e3d234916 SHA512 d7121dade4fc06568cfb650a529dda350c60171e97ca405d29b9654a9fd06e453d20f8efc2fd8c51f530cfb0708648b2b2ba06ab40897b262ef2f3baf04d65a7
|
||||||
DIST github.com-unrolled-secure-4b6b7cf51606.tar.gz 11576 BLAKE2B d1b583c8809376cc31c6c14ce9e81ffa50e836fad4e6ee6724931f65f27982dcb0f43f39e82e13324243e9b420653ff3208927a7d8836d06ecfbd3fbb917a468 SHA512 b0949cff040c43b8c39ca14935d1f07797a71d1d909d1cb9856a0a308c4be08ee05d43cdfe3e1739d2dcf35cbd9c5a4217f2f96e8cb29c694b7a0b5027940aaf
|
DIST github.com-unrolled-secure-4b6b7cf51606.tar.gz 11576 BLAKE2B d1b583c8809376cc31c6c14ce9e81ffa50e836fad4e6ee6724931f65f27982dcb0f43f39e82e13324243e9b420653ff3208927a7d8836d06ecfbd3fbb917a468 SHA512 b0949cff040c43b8c39ca14935d1f07797a71d1d909d1cb9856a0a308c4be08ee05d43cdfe3e1739d2dcf35cbd9c5a4217f2f96e8cb29c694b7a0b5027940aaf
|
||||||
EBUILD drone-1.1.0.ebuild 5476 BLAKE2B ddd9dee5e35b6e4cadaaa08ae070dafe811a6281add85566e1fbdb48690ad971856a3d0d45810f68c8d5a4bea5a7d427ff991af6ee73e3f7634fa23e9a5ef9d6 SHA512 5edd0d5b64f1a1bd1607b9105ed16a1b71cb6616d5ae913219cdca3cc58666bc05ab29d8c9cd18af2acb372d5467cd01aa8821bd46bfde9c42d0f603d757a440
|
EBUILD drone-1.1.0-r1.ebuild 5638 BLAKE2B b9f32bcae73e3c17ed6017773e7d7c15558d43337d33563519f57e550e46eaacd8033228c08c3f27e88f308bf3fe76779fbac4d7b0f05da1b7607d41fedf73f6 SHA512 1077791636df200bfe42d54da1113ef0bc1b31224a7b746dc41ec181d5607d5b21e5031cb717a4e2fa55b03dbd2537e19c9e2570018d89d2d5efef8deb1e11ca
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Copyright 1999-2018 Gentoo Authors
|
# Copyright 1999-2018 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=5
|
EAPI=7
|
||||||
|
|
||||||
EGO_PN="github.com/drone/drone"
|
EGO_PN="github.com/drone/drone"
|
||||||
EGIT_COMMIT="416f94afcd1596c8baf276e909acd1009088c695"
|
EGIT_COMMIT="416f94afcd1596c8baf276e909acd1009088c695"
|
||||||
@ -106,15 +106,17 @@ inherit golang-build golang-vcs-snapshot user
|
|||||||
|
|
||||||
ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
|
ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
|
||||||
KEYWORDS="~amd64"
|
KEYWORDS="~amd64"
|
||||||
|
IUSE="ose"
|
||||||
|
|
||||||
DESCRIPTION="A Continuous Delivery platform built on Docker, written in Go"
|
DESCRIPTION="A Continuous Delivery platform built on Docker, written in Go"
|
||||||
HOMEPAGE="https://github.com/drone/drone"
|
HOMEPAGE="https://github.com/drone/drone"
|
||||||
SRC_URI="${ARCHIVE_URI}
|
SRC_URI="${ARCHIVE_URI}
|
||||||
${EGO_VENDOR_URI}"
|
${EGO_VENDOR_URI}"
|
||||||
LICENSE="Apache-2.0"
|
LICENSE="Apache-2.0 !ose? ( Drone Enterprise License )"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
|
|
||||||
RESTRICT="strip"
|
# We build with ldflags -s -w
|
||||||
|
RESTRICT="strip mirror"
|
||||||
|
|
||||||
pkg_setup() {
|
pkg_setup() {
|
||||||
enewgroup ${PN}
|
enewgroup ${PN}
|
||||||
@ -124,13 +126,16 @@ pkg_setup() {
|
|||||||
src_compile() {
|
src_compile() {
|
||||||
pushd src/${EGO_PN}
|
pushd src/${EGO_PN}
|
||||||
|
|
||||||
EGO_BUILD_FLAGS="-tags oss -o ${T}/drone-server -mod=vendor"
|
EGO_BUILD_FLAGS="-o ${T}/drone-server -mod=vendor"
|
||||||
|
if use ose; then
|
||||||
|
EGO_BUILD_FLAGS="$EGO_BUILD_FLAGS -tags oss"
|
||||||
|
fi
|
||||||
EGO_PN="${EGO_PN}/cmd/drone-server"
|
EGO_PN="${EGO_PN}/cmd/drone-server"
|
||||||
|
|
||||||
export CGO_ENABLED=1
|
export CGO_ENABLED=1
|
||||||
set -- env GOPATH="${T}:$(get_golibdir_gopath)" \
|
set -- env GOPATH="${T}:$(get_golibdir_gopath)" \
|
||||||
GOCACHE="${T}/go-cache" \
|
GOCACHE="${T}/go-cache" \
|
||||||
go build -v -work -x ${EGO_BUILD_FLAGS} -ldflags "-X ${EGO_PN}/version.VersionDev=build.${PV}.${EGIT_COMMIT:0:7}" "${EGO_PN}"
|
go build -v -work -x ${EGO_BUILD_FLAGS} -ldflags "-s -w -X ${EGO_PN}/version.VersionDev=build.${PV}.${EGIT_COMMIT:0:7}" "${EGO_PN}"
|
||||||
echo "$@"
|
echo "$@"
|
||||||
"$@" || die
|
"$@" || die
|
||||||
popd
|
popd
|
||||||
@ -138,8 +143,8 @@ src_compile() {
|
|||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
dobin ${T}/drone-server
|
dobin ${T}/drone-server
|
||||||
keepdir /var/log/drone /var/lib/drone
|
keepdir /var/log/drone-server /var/lib/drone
|
||||||
fowners -R ${PN}:${PN} /var/log/drone /var/lib/drone
|
fowners -R ${PN}:${PN} /var/log/drone-server /var/lib/drone
|
||||||
newinitd "${FILESDIR}"/drone-server.initd drone-server
|
newinitd "${FILESDIR}"/drone-server.initd drone-server
|
||||||
newconfd "${FILESDIR}"/drone-server.confd drone-server
|
newconfd "${FILESDIR}"/drone-server.confd drone-server
|
||||||
}
|
}
|
@ -1,55 +1,8 @@
|
|||||||
# config file for /etc/init.d/drone-server
|
# config file for /etc/init.d/drone-server
|
||||||
# See also http://readme.drone.io/admin/installation-reference/
|
# See also http://readme.drone.io/admin/installation-reference/
|
||||||
|
|
||||||
DRONE_DATADIR="/var/lib/drone"
|
|
||||||
DRONE_LOGDIR="/var/log/drone"
|
|
||||||
|
|
||||||
#DRONE_SECRET=
|
|
||||||
#DRONE_DEBUG=false
|
|
||||||
#DRONE_SERVER_CERT=
|
|
||||||
#DRONE_SERVER_KEY=
|
|
||||||
#DRONE_ADMIN=
|
|
||||||
#DRONE_ORGS=
|
|
||||||
#DRONE_OPEN=false
|
|
||||||
#DRONE_YAML=.drone.yml
|
|
||||||
#DRONE_CACHE_TTY=15m
|
|
||||||
DRONE_DATABASE_DRIVER=sqlite3
|
DRONE_DATABASE_DRIVER=sqlite3
|
||||||
DRONE_DATABASE_DATASOURCE="/var/lib/drone/drone.sqlite"
|
DRONE_DATABASE_DATASOURCE="/var/lib/drone/drone.sqlite"
|
||||||
#DRONE_GITHUB=true
|
|
||||||
#DRONE_GITHUB_URL=https://github.com
|
|
||||||
#DRONE_GITHUB_CLIENT=
|
|
||||||
#DRONE_GITHUB_SECRET=
|
|
||||||
#DRONE_GITHUB_SCOPE=
|
|
||||||
#DRONE_GITHUB_GIT_USERNAME=
|
|
||||||
#DRONE_GITHUB_GIT_PASSWORD=
|
|
||||||
#DRONE_GITHUB_PRIVATE_MODE=false
|
|
||||||
#DRONE_GITHUB_MERGE_REF=true
|
|
||||||
#DRONE_GITHUB_CONTEXT=continuous-integration/drone
|
|
||||||
#DRONE_GITHUB_SKIP_VERIFY=false
|
|
||||||
#DRONE_GOGS=false
|
|
||||||
#DRONE_GOGS_URL=
|
|
||||||
#DRONE_GOGS_GIT_USERNAME=
|
|
||||||
#DRONE_GOGS_GIT_PASSWORD=
|
|
||||||
#DRONE_GOGS_PRIVATE_MODE=
|
|
||||||
#DRONE_GOGS_SKIP_VERIFY=false
|
|
||||||
#DRONE_BITBUCKET=false
|
|
||||||
#DRONE_BITBUCKET_CLIENT=
|
|
||||||
#DRONE_BITBUCKET_SECRET=
|
|
||||||
#DRONE_STASH=false
|
|
||||||
#DRONE_STASH_URL=
|
|
||||||
#DRONE_STASH_CONSUMER_KEY=
|
|
||||||
#DRONE_STASH_CONSUMER_RSA=
|
|
||||||
#DRONE_STASH_GIT_USERNAME=
|
|
||||||
#DRONE_STASH_GIT_PASSWORD=
|
|
||||||
#DRONE_GITLAB=false
|
|
||||||
#DRONE_GITLAB_URL=https://gitlab.com
|
|
||||||
#DRONE_GITLAB_CLIENT=
|
|
||||||
#DRONE_GITLAB_SECRET=
|
|
||||||
#DRONE_GITLAB_GIT_USERNAME=
|
|
||||||
#DRONE_GITLAB_GIT_PASSWORD=
|
|
||||||
#DRONE_GITLAB_SKIP_VERIFY=false
|
|
||||||
#DRONE_GITLAB_PRIVATE_MODE=false
|
|
||||||
|
|
||||||
# Logging
|
# Default backend
|
||||||
#output_log="${DRONE_LOGDIR}/drone-server.log"
|
DRONE_GITHUB=true
|
||||||
#error_log="${DRONE_LOGDIR}/server-error.log"
|
|
||||||
|
@ -2,18 +2,16 @@
|
|||||||
# Copyright 2015-2018 Gentoo Authors
|
# Copyright 2015-2018 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
output_log="${output_log:-/dev/null}"
|
|
||||||
error_log="${error_log:-${DRONE_LOGDIR}/server-error.log}"
|
|
||||||
|
|
||||||
name="${name:-Drone CI Server}"
|
name="${name:-Drone CI Server}"
|
||||||
command="/usr/bin/drone-server"
|
command="/usr/bin/drone-server"
|
||||||
command_user="${command_use:-drone:drone}"
|
command_args="-env-file /etc/conf.d/drone-server"
|
||||||
command_background=true
|
command_background=true
|
||||||
pidfile="/run/${RC_SVCNAME}.pid"
|
pidfile="/run/${RC_SVCNAME}.pid"
|
||||||
retry="${retry:-TERM/30/KILL/5}"
|
retry="${retry:-TERM/30/KILL/5}"
|
||||||
start_stop_daemon_args="${SSD_OPTS}"
|
start_stop_daemon_args="${SSD_OPTS}"
|
||||||
|
user=${user:-drone}
|
||||||
|
group=${group:-drone}
|
||||||
|
|
||||||
start_pre() {
|
start_stop_daemon_args="--user ${user} --group ${group} \
|
||||||
checkpath -d -m 0700 -o "${command_user}" \
|
--stdout /var/log/${SVCNAME}/${SVCNAME}.log \
|
||||||
"${DRONE_DATADIR}" "${DRONE_LOGDIR}"
|
--stderr /var/log/${SVCNAME}/${SVCNAME}.err"
|
||||||
}
|
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
import re
|
|
||||||
|
|
||||||
url_map = {
|
|
||||||
"golang.org": "github.com/golang",
|
|
||||||
"google.golang.org": "github.com/golang",
|
|
||||||
"docker.io": "github.com/docker",
|
|
||||||
"k8s.io": "github.com/kubernetes",
|
|
||||||
"sigs.k8s.io": "github.com/kubernetes-sigs",
|
|
||||||
"gopkg.in": "github.com/go-"
|
|
||||||
}
|
|
||||||
with open("go.mod", "r") as data:
|
|
||||||
print("EGO_VENDOR=(")
|
|
||||||
for line in data:
|
|
||||||
pkg = re.match(r"\t(?P<pkg>[^ ]*) (?P<version>[^ ]*)\s.*", line)
|
|
||||||
if pkg:
|
|
||||||
ver = re.match(r"v\d.\d.\d-.*-(?P<commit>[^ ]*)", pkg.group('version'))
|
|
||||||
if ver:
|
|
||||||
commit = ver.group('commit')
|
|
||||||
else:
|
|
||||||
commit = pkg.group('version')
|
|
||||||
commit = re.sub("\+incompatible", "", commit)
|
|
||||||
|
|
||||||
pkg_tokens = pkg.group('pkg').split("/")
|
|
||||||
if pkg_tokens[0] in url_map.keys():
|
|
||||||
if pkg_tokens[0] == "gopkg.in":
|
|
||||||
(pkg_name, branch) = pkg_tokens[-1].split(".")
|
|
||||||
print("\t\"{}/{} {} {}{}/{}\"".format("/".join(pkg_tokens[:-1]), pkg_tokens[-1], commit, url_map[pkg_tokens[0]], pkg_name, pkg_name))
|
|
||||||
else:
|
|
||||||
print("\t\"{}/{} {} {}/{}\"".format("/".join(pkg_tokens[:-1]), pkg_tokens[-1], commit, url_map[pkg_tokens[0]], pkg_tokens[-1]))
|
|
||||||
else:
|
|
||||||
print("\t\"{} {}\"".format(pkg.group('pkg'), commit))
|
|
||||||
print("\t)")
|
|
Loading…
Reference in New Issue
Block a user