This repository has been archived by the owner on Dec 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
.drone.yml
126 lines (119 loc) · 2.98 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
kind: pipeline
name: default
steps:
- name: test app
image: docker
commands:
- docker build -t kgs-test -f Dockerfile-test .
- docker run kgs-test
volumes:
- name: docker
path: /var/run/docker.sock
when:
branch:
- master
event:
- pull_request
- name: report code coverage
image: docker
environment:
CODECOV_TOKEN:
from_secret: CODECOV_TOKEN
commands:
- docker build -t kgs-report-coverage --build-arg CODECOV_TOKEN=$CODECOV_TOKEN -f Dockerfile-coverage .
- docker run kgs-report-coverage
volumes:
- name: docker
path: /var/run/docker.sock
when:
branch:
- master
event:
- pull_request
- name: build app
image: docker
commands:
- docker build -t kgs:latest -f Dockerfile .
volumes:
- name: docker
path: /var/run/docker.sock
when:
branch:
- master
event:
- push
- name: build testing app
image: docker
commands:
- docker build -t kgs-testing:latest -f Dockerfile .
volumes:
- name: docker
path: /var/run/docker.sock
when:
branch:
- testing
event:
- push
- name: publish testing image to DockerHub
image: docker
environment:
DOCKERHUB_USERNAME:
from_secret: DOCKERHUB_USERNAME
DOCKERHUB_PASSWORD:
from_secret: DOCKERHUB_PASSWORD
DOCKERHUB_ORG_ID:
from_secret: DOCKERHUB_ORG_ID
commands:
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- docker tag kgs-testing:latest $DOCKERHUB_ORG_ID/kgs-testing:latest
- docker push $DOCKERHUB_ORG_ID/kgs-testing:latest
volumes:
- name: docker
path: /var/run/docker.sock
when:
branch:
- testing
event:
- push
- name: publish staging image to DockerHub
image: docker
environment:
DOCKERHUB_USERNAME:
from_secret: DOCKERHUB_USERNAME
DOCKERHUB_PASSWORD:
from_secret: DOCKERHUB_PASSWORD
commands:
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- docker tag kgs:latest $DOCKERHUB_USERNAME/kgs-staging:latest
- docker push $DOCKERHUB_USERNAME/kgs-staging:latest
volumes:
- name: docker
path: /var/run/docker.sock
when:
branch:
- master
event:
- push
- name: publish production image to DockerHub
image: docker
environment:
DOCKERHUB_USERNAME:
from_secret: DOCKERHUB_USERNAME
DOCKERHUB_PASSWORD:
from_secret: DOCKERHUB_PASSWORD
commands:
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- docker tag kgs:latest $DOCKERHUB_USERNAME/kgs:latest
- docker push $DOCKERHUB_USERNAME/kgs:latest
volumes:
- name: docker
path: /var/run/docker.sock
when:
branch:
- production
event:
- push
volumes:
- name: docker
host:
path: /var/run/docker.sock