forked from owncloud-docker/server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
249 lines (226 loc) · 7.6 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
workspace:
base: /drone
path: src/github.com/owncloud-docker/server
branches:
- master
clone:
git:
image: plugins/git:1
pull: true
pipeline:
tarball:
image: plugins/download:1
pull: true
secrets: [ download_username, download_password ]
source: https://download.owncloud.org/community/owncloud-10.1.0.tar.bz2
sha256: e45db1e3f7d7649a61ad16b2391e3a582f49012300540847e8fc656789e123ff
ldap:
image: plugins/download:1
pull: true
source: https://marketplace.owncloud.com/api/v1/apps/user_ldap/0.13.0
sha256: f35042d11df9c26d22af44dba600efa3b7d134bf93294923ebd8c5fd506a65b3
destination: user_ldap.tar.gz
wait:
image: owncloud/ubuntu:latest
pull: true
commands:
- wait-for-it -t 600 docker:2375
build:
image: toolhippie/docker:latest
pull: true
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- docker build -t owncloud/server:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} .
smoketest-prepare-testsuite:
image: owncloudci/php
pull: true
commands:
- mkdir -p /drone/owncloud-smoketest
- wget -qO- "https://download.owncloud.org/community/owncloud-daily-stable10-qa.tar.bz2" | tar -xj -C /drone/owncloud-smoketest --strip 1
- cat /drone/owncloud-smoketest/version.php
- mkdir -p /drone/owncloud-smoketest/vendor-bin/behat
- wget https://raw.githubusercontent.com/owncloud/core/stable10/vendor-bin/behat/composer.json -O /drone/owncloud-smoketest/vendor-bin/behat/composer.json
- cd /drone/owncloud-smoketest/vendor-bin/behat/ && composer install
smoketest-create-docker-network:
image: toolhippie/docker:latest
pull: true
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- docker network create oc
smoketest-redis:
image: toolhippie/docker:latest
pull: true
detach: true
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- docker run --network=oc --name redis --network-alias redis library/redis:4
smoketest-database:
image: toolhippie/docker:latest
pull: true
detach: true
environment:
- DOCKER_HOST=tcp://docker:2375
- MYSQL_ROOT_PASSWORD=owncloud
- MYSQL_USER=owncloud
- MYSQL_PASSWORD=owncloud
- MYSQL_DATABASE=owncloud
commands:
- |
docker run --network=oc --name db --network-alias db \
-e MYSQL_ROOT_PASSWORD \
-e MYSQL_USER \
-e MYSQL_PASSWORD \
-e MYSQL_DATABASE \
library/mysql:5.7
smoketest-mailhog:
image: toolhippie/docker:latest
pull: true
detach: true
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- docker run -p 1025:1025 -p 8025:8025 --network=oc --network-alias email --name email mailhog/mailhog:latest
smoketest-server:
image: toolhippie/docker:latest
pull: true
detach: true
environment:
- DOCKER_HOST=tcp://docker:2375
- DEBUG=true
- OWNCLOUD_REDIS_HOST=redis
- OWNCLOUD_DB_TYPE=mysql
- OWNCLOUD_DB_NAME=owncloud
- OWNCLOUD_DB_USERNAME=owncloud
- OWNCLOUD_DB_PASSWORD=owncloud
- OWNCLOUD_DB_HOST=db
- OWNCLOUD_APPS_INSTALL=https://github.com/owncloud/testing/releases/download/latest/testing.tar.gz
- OWNCLOUD_APPS_ENABLE=testing
commands:
- |
docker run \
--network=oc \
--name owncloud \
-e DEBUG \
-p 8000:8080 \
-e OWNCLOUD_APPS_INSTALL \
-e OWNCLOUD_APPS_ENABLE \
-e OWNCLOUD_REDIS_HOST \
-e OWNCLOUD_DB_TYPE \
-e OWNCLOUD_DB_NAME \
-e OWNCLOUD_DB_USERNAME \
-e OWNCLOUD_DB_PASSWORD \
-e OWNCLOUD_DB_HOST \
--network=oc \
owncloud/server:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER}
wait-for-owncloud:
image: owncloud/ubuntu:latest
pull: true
commands:
- wait-for-it -t 600 docker:8000
run-api-smoke-test:
image: owncloudci/php
pull: true
environment:
- TEST_SERVER_URL=http://docker:8000
- SKELETON_DIR=/mnt/data/apps/testing/data/apiSkeleton
commands:
- cd /drone/owncloud-smoketest/tests/acceptance
- bash run.sh --remote --tags "@smokeTest&&~@skip&&~@skipOnDockerContainerTesting" --type api
run-ui-smoke-test:
image: owncloudci/php
pull: true
environment:
- BROWSER=chrome
- SELENIUM_HOST=selenium
- SELENIUM_PORT=4444
- PLATFORM=Linux
- MAILHOG_HOST=email
- LOCAL_MAILHOG_HOST=docker
- TEST_SERVER_URL=http://docker:8000
- SKELETON_DIR=/mnt/data/apps/testing/data/webUISkeleton
commands:
- cd /drone/owncloud-smoketest/tests/acceptance
- bash run.sh --remote --tags "@smokeTest&&~@skip&&~@skipOnDockerContainerTesting" --type webUI
prepublish:
image: toolhippie/docker:latest
pull: true
secrets: [ docker_username, docker_password ]
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- docker push owncloud/server:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER}
when:
event: [ push, pull_request ]
clair:
image: toolhippie/klar:latest
pull: true
secrets:
- source: docker_username
target: docker_user
- source: docker_password
target: docker_password
environment:
- CLAIR_ADDR=clair.owncloud.com
- CLAIR_OUTPUT=High
commands:
- klar owncloud/server:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER}
when:
event: [ push, pull_request ]
publish:
image: toolhippie/docker:latest
pull: true
secrets: [ docker_username, docker_password ]
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- docker tag owncloud/server:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} owncloud/server:latest
- docker push owncloud/server:latest
- docker tag owncloud/server:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} owncloud/server:latest-$(date '+%Y%m%d')
- docker push owncloud/server:latest-$(date '+%Y%m%d')
- docker tag owncloud/server:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} owncloud/server:10.1.0
- docker push owncloud/server:10.1.0
- docker tag owncloud/server:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} owncloud/server:10.1.0-$(date '+%Y%m%d')
- docker push owncloud/server:10.1.0-$(date '+%Y%m%d')
- docker tag owncloud/server:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} owncloud/server:10.1
- docker push owncloud/server:10.1
when:
event: [ push ]
cleanup:
image: toolhippie/jq:latest
pull: true
secrets: [ docker_username, docker_password ]
commands:
- |
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'"$DOCKER_USERNAME"'", "password": "'"$DOCKER_PASSWORD"'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
curl -sSf -o /dev/null -H "Authorization: JWT $TOKEN" -H "Content-Type: application/json" -X DELETE https://hub.docker.com/v2/repositories/owncloud/server/tags/${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER}/
when:
event: [ push, pull_request ]
status: [ success, failure ]
microbadger:
image: plugins/webhook:1
pull: true
secrets: [ webhook_urls ]
when:
local: false
event: [ push ]
slack:
image: plugins/slack:1
pull: true
secrets: [ slack_webhook ]
channel: docker
when:
local: false
event: [ push ]
status: [ changed, failure ]
services:
docker:
image: docker:18.04-dind
pull: true
selenium:
image: selenium/standalone-chrome-debug:latest
pull: true