1 |
commit: 65f8e2da388d73dc4db151cc983bd7eea756c006 |
2 |
Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 11 14:53:21 2017 +0000 |
4 |
Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 11 14:53:21 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65f8e2da |
7 |
|
8 |
dev-util/drone: Add initscript, add user |
9 |
|
10 |
Package-Manager: Portage-2.3.5, Repoman-2.3.2 |
11 |
|
12 |
dev-util/drone/drone-0.5.0-r1.ebuild | 51 ++++++++++++++++++++++++++++++++++ |
13 |
dev-util/drone/files/drone-agent.confd | 19 +++++++++++++ |
14 |
dev-util/drone/files/drone-agent.initd | 18 ++++++++++++ |
15 |
dev-util/drone/files/drone.confd | 47 +++++++++++++++++++++++++++++++ |
16 |
dev-util/drone/files/drone.initd | 18 ++++++++++++ |
17 |
5 files changed, 153 insertions(+) |
18 |
|
19 |
diff --git a/dev-util/drone/drone-0.5.0-r1.ebuild b/dev-util/drone/drone-0.5.0-r1.ebuild |
20 |
new file mode 100644 |
21 |
index 00000000000..fd0af970489 |
22 |
--- /dev/null |
23 |
+++ b/dev-util/drone/drone-0.5.0-r1.ebuild |
24 |
@@ -0,0 +1,51 @@ |
25 |
+# Copyright 1999-2017 Gentoo Foundation |
26 |
+# Distributed under the terms of the GNU General Public License v2 |
27 |
+ |
28 |
+EAPI=6 |
29 |
+ |
30 |
+EGO_PN="github.com/drone/drone/..." |
31 |
+EGIT_COMMIT="dc5f01d00ec2970fe881c6633fbf69f6f0cb8950" |
32 |
+EGO_VENDOR=( "github.com/drone/mq 280af2a3b9c7d9ce90d625150dfff972c6c190b8" |
33 |
+ "github.com/tidwall/redlog 550629ebbfa9925a73f69cce7cdd2e8dae52c713" |
34 |
+ "golang.org/x/crypto 728b753d0135da6801d45a38e6f43ff55779c5c2 github.com/golang/crypto" ) |
35 |
+ |
36 |
+inherit golang-build golang-vcs-snapshot user |
37 |
+ |
38 |
+ARCHIVE_URI="https://${EGO_PN%/*}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
39 |
+KEYWORDS="~amd64" |
40 |
+ |
41 |
+DESCRIPTION="A Continuous Delivery platform built on Docker, written in Go" |
42 |
+HOMEPAGE="https://github.com/drone/drone" |
43 |
+SRC_URI="${ARCHIVE_URI} |
44 |
+ ${EGO_VENDOR_URI}" |
45 |
+LICENSE="Apache-2.0" |
46 |
+SLOT="0" |
47 |
+IUSE="" |
48 |
+ |
49 |
+DEPEND="dev-go/go-bindata |
50 |
+ dev-go/go-bindata-assetfs:= |
51 |
+ dev-util/drone-ui:=" |
52 |
+ |
53 |
+pkg_setup() { |
54 |
+ enewgroup drone |
55 |
+ enewuser drone -1 -1 -1 drone |
56 |
+} |
57 |
+ |
58 |
+src_compile() { |
59 |
+ GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/github.com/drone/drone gen || die |
60 |
+ pushd src || die |
61 |
+ DRONE_BUILD_NUMBER="${EGIT_COMMIT:0:7}" GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)"\ |
62 |
+ go install -ldflags "-extldflags '-static' -X github.com/drone/drone/version.VersionDev=${EGIT_COMMIT:0:7}" github.com/drone/drone/drone || die |
63 |
+ popd || die |
64 |
+} |
65 |
+ |
66 |
+src_install() { |
67 |
+ dobin bin/* |
68 |
+ dodoc src/github.com/drone/drone/README.md |
69 |
+ keepdir /var/log/drone /var/lib/drone |
70 |
+ fowners -R drone:drone /var/log/drone /var/lib/drone |
71 |
+ newinitd "${FILESDIR}"/drone.initd drone |
72 |
+ newconfd "${FILESDIR}"/drone.confd drone |
73 |
+ newinitd "${FILESDIR}"/drone-agent.initd drone-agent |
74 |
+ newconfd "${FILESDIR}"/drone-agent.confd drone-agent |
75 |
+} |
76 |
|
77 |
diff --git a/dev-util/drone/files/drone-agent.confd b/dev-util/drone/files/drone-agent.confd |
78 |
new file mode 100644 |
79 |
index 00000000000..bfe82b16c75 |
80 |
--- /dev/null |
81 |
+++ b/dev-util/drone/files/drone-agent.confd |
82 |
@@ -0,0 +1,19 @@ |
83 |
+# arguments for drone-agent |
84 |
+# See also http://readme.drone.io/admin/installation-reference/ |
85 |
+#DRONE_SERVER= |
86 |
+#DRONE_SECRET= |
87 |
+#DRONE_DEBUG=false |
88 |
+#DRONE_BACKOFF=15s |
89 |
+#DRONE_TIMEOUT=15m |
90 |
+#DRONE_MAX_LOGS=5 |
91 |
+#DRONE_PLUGIN_PULL=true |
92 |
+#DRONE_PLUGIN_PRIVILEGED |
93 |
+#DOCKER_HOST |
94 |
+#DOCKER_TLS_VERIFY |
95 |
+#DOCKER_CERT_PATH |
96 |
+#DOCKER_MAX_PROCS=2 |
97 |
+#DOCKER_OS=linux |
98 |
+#DOCKER_ARCH=amd64 |
99 |
+#HTTP_PROXY= |
100 |
+#HTTPS_PROXY= |
101 |
+#NO_PROXY= |
102 |
|
103 |
diff --git a/dev-util/drone/files/drone-agent.initd b/dev-util/drone/files/drone-agent.initd |
104 |
new file mode 100644 |
105 |
index 00000000000..b231f518fd6 |
106 |
--- /dev/null |
107 |
+++ b/dev-util/drone/files/drone-agent.initd |
108 |
@@ -0,0 +1,18 @@ |
109 |
+#!/sbin/openrc-run |
110 |
+# Copyright 2017 Gentoo Foundation |
111 |
+# Distributed under the terms of the GNU General Public License v2 |
112 |
+ |
113 |
+description="Drone CI Agent" |
114 |
+pidfile=${pidfile:-"/run/drone/${SVCNAME}.pid"} |
115 |
+user=${user:-drone} |
116 |
+group=${group:-drone} |
117 |
+ |
118 |
+command="/usr/bin/drone agent" |
119 |
+command_background="true" |
120 |
+start_stop_daemon_args="--user ${user} --group ${group} \ |
121 |
+ --stdout /var/log/drone/${SVCNAME}.log \ |
122 |
+ --stderr /var/log/drone/${SVCNAME}.log" |
123 |
+ |
124 |
+start_pre() { |
125 |
+ checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}" |
126 |
+} |
127 |
|
128 |
diff --git a/dev-util/drone/files/drone.confd b/dev-util/drone/files/drone.confd |
129 |
new file mode 100644 |
130 |
index 00000000000..5f4bb24dc28 |
131 |
--- /dev/null |
132 |
+++ b/dev-util/drone/files/drone.confd |
133 |
@@ -0,0 +1,47 @@ |
134 |
+# arguments for drone |
135 |
+# See also http://readme.drone.io/admin/installation-reference/ |
136 |
+#DRONE_SECRET= |
137 |
+#DRONE_DEBUG=false |
138 |
+#DRONE_SERVER_CERT= |
139 |
+#DRONE_SERVER_KEY= |
140 |
+#DRONE_ADMIN= |
141 |
+#DRONE_ORGS= |
142 |
+#DRONE_OPEN=false |
143 |
+#DRONE_YAML=.drone.yml |
144 |
+#DRONE_CACHE_TTY=15m |
145 |
+#DRONE_DATABASE_DRIVER=sqlite3 |
146 |
+DRONE_DATABASE_DATASOURCE="/var/lib/drone/drone.sqlite" |
147 |
+#DRONE_GITHUB=false |
148 |
+#DRONE_GITHUB_URL=https://github.com |
149 |
+#DRONE_GITHUB_CLIENT= |
150 |
+#DRONE_GITHUB_SECRET= |
151 |
+#DRONE_GITHUB_SCOPE= |
152 |
+#DRONE_GITHUB_GIT_USERNAME= |
153 |
+#DRONE_GITHUB_GIT_PASSWORD= |
154 |
+#DRONE_GITHUB_PRIVATE_MODE=false |
155 |
+#DRONE_GITHUB_MERGE_REF=true |
156 |
+#DRONE_GITHUB_CONTEXT=continuous-integration/drone |
157 |
+#DRONE_GITHUB_SKIP_VERIFY=false |
158 |
+#DRONE_GOGS=false |
159 |
+#DRONE_GOGS_URL= |
160 |
+#DRONE_GOGS_GIT_USERNAME= |
161 |
+#DRONE_GOGS_GIT_PASSWORD= |
162 |
+#DRONE_GOGS_PRIVATE_MODE= |
163 |
+#DRONE_GOGS_SKIP_VERIFY=false |
164 |
+#DRONE_BITBUCKET=false |
165 |
+#DRONE_BITBUCKET_CLIENT= |
166 |
+#DRONE_BITBUCKET_SECRET= |
167 |
+#DRONE_STASH=false |
168 |
+#DRONE_STASH_URL= |
169 |
+#DRONE_STASH_CONSUMER_KEY= |
170 |
+#DRONE_STASH_CONSUMER_RSA= |
171 |
+#DRONE_STASH_GIT_USERNAME= |
172 |
+#DRONE_STASH_GIT_PASSWORD= |
173 |
+#DRONE_GITLAB=false |
174 |
+#DRONE_GITLAB_URL=https://gitlab.com |
175 |
+#DRONE_GITLAB_CLIENT= |
176 |
+#DRONE_GITLAB_SECRET= |
177 |
+#DRONE_GITLAB_GIT_USERNAME= |
178 |
+#DRONE_GITLAB_GIT_PASSWORD= |
179 |
+#DRONE_GITLAB_SKIP_VERIFY=false |
180 |
+#DRONE_GITLAB_PRIVATE_MODE=false |
181 |
|
182 |
diff --git a/dev-util/drone/files/drone.initd b/dev-util/drone/files/drone.initd |
183 |
new file mode 100644 |
184 |
index 00000000000..0840db86bf9 |
185 |
--- /dev/null |
186 |
+++ b/dev-util/drone/files/drone.initd |
187 |
@@ -0,0 +1,18 @@ |
188 |
+#!/sbin/openrc-run |
189 |
+# Copyright 2016-2017 Gentoo Foundation |
190 |
+# Distributed under the terms of the GNU General Public License v2 |
191 |
+ |
192 |
+description="Drone CI" |
193 |
+pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"} |
194 |
+user=${user:-${SVCNAME}} |
195 |
+group=${group:-${SVCNAME}} |
196 |
+ |
197 |
+command="/usr/bin/drone server" |
198 |
+command_background="true" |
199 |
+start_stop_daemon_args="--user ${user} --group ${group} \ |
200 |
+ --stdout /var/log/${SVCNAME}/${SVCNAME}.log \ |
201 |
+ --stderr /var/log/${SVCNAME}/${SVCNAME}.log" |
202 |
+ |
203 |
+start_pre() { |
204 |
+ checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}" |
205 |
+} |