-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.drone.yml
132 lines (123 loc) · 3.64 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
workspace:
base: /go
path: src/github.com/readr-media/readr-restful
pipeline:
start_slack:
image: plugins/slack
channel: jenkins
secrets: [slack_webhook]
username: drone
icon_url: https://avatars2.githubusercontent.com/u/2181346?s=200&v=4
template: >
*start* building *{{repo.name}}*.
*{{build.author}}* give *{{build.branch}}* a little push.
when:
event: [push]
branch: [master, dev]
get_config_dev:
image: gcr.io/mirrormedia-1470651750304/drone-cloud-sdk:latest
secrets: [google_credentials]
commands:
- gcloud source repos clone configs rr-configs
- cp rr-configs/readr-media/readr-restful/dev/main.json ./config/main.json
- cp rr-configs/readr-media/readr-restful/*.html ./config/
when:
event: [pull_request, push]
branch: [dev]
pull_request_test:
image: golang:1.14-alpine
environment:
- GO111MODULE=on
commands:
- apk add --update git make
- make deps
- make test
when:
event: [pull_request]
branch: [dev]
pr_integration_test:
image: golang:1.14-alpine
environment:
- GO111MODULE=on
commands:
- cp rr-configs/readr-media/readr-restful/integration_test/main.json config/integration_test.json
- cp rr-configs/readr-media/readr-restful/*.html ./config/
- sleep 30
- apk add --update git make
- make deps
- make test-integration
- rm config/integration_test.json
when:
event: [pull_request]
branch: [dev]
config_clean:
image: golang:1.14-alpine
commands:
- rm -rf rr-configs
when:
event: [pull_request, push]
branch: [dev]
builds:
image: golang:1.14-alpine
environment:
- GO111MODULE=on
commands:
- apk update
- apk add git make
- make build-alpine
when:
event: [push]
branch: dev
publish:
image: plugins/gcr
repo: mirrormedia-1470651750304/${DRONE_REPO_NAME}
tag: ${DRONE_COMMIT_BRANCH}_${DRONE_COMMIT_AUTHOR}_${DRONE_BUILD_NUMBER}
environment:
- DOCKER_LAUNCH_DEBUG=true
secrets: [google_credentials]
when:
event: [push]
branch: [dev]
pr_test_fail:
image: plugins/slack
channel: jenkins
secrets: [slack_webhook]
username: drone
icon_url: https://avatars2.githubusercontent.com/u/2181346?s=200&v=4
when:
status: [success, failure]
event: [pull_request]
branch: [dev]
template: >
{{# success build.status}}
The pull request *passes* tests. Please review the <https://github.com/{{repo.owner}}/{{repo.name}}/pull/{{build.pull}}|pull request>
{{else}}
The pull request *failed* tests. Please modify your <https://github.com/{{repo.owner}}/{{repo.name}}/pull/{{build.pull}}|commit>
{{/success}}
finish_slack:
image: plugins/slack
channel: jenkins
secrets: [slack_webhook]
username: drone
icon_url: https://avatars2.githubusercontent.com/u/2181346?s=200&v=4
when:
status: [success, failure]
event: [push]
branch: [master, dev]
template: >
{{#success build.status}}
Build<${DRONE_BUILD_LINK}|#{{build.number}}> *success* ${DRONE_REPO_NAME}:${DRONE_COMMIT_AUTHOR}_${DRONE_BUILD_NUMBER} was well served.
Check out our new <https://gcr.io/mirrormedia-1470651750304/readr-restful|rest>
{{else}}
Houston, we have a problem. Build <${DRONE_BUILD_LINK}|#{{build.number}}> failed. Fix me please, {{build.author}}
{{/success}}
services:
mysql:
image: mysql:5.7.24
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_DATABASE=memberdb
cap_add:
- seccomp:unconfined
redis:
image: redis