-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
136 lines (126 loc) · 2.79 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
kind: pipeline
name: default
platform:
os: linux
arch: amd64
clone:
disable: true
steps:
- name: git
pull: default
image: plugins/git
settings:
depth: 50
tags: true
- name: restore-cache
pull: default
image: drillster/drone-volume-cache
settings:
mount:
- ./.ivy2
- ./.coursier
restore: true
volumes:
- name: cache
path: /cache
when:
event:
- push
- promote
- tag
- name: run-tests
pull: default
image: gwiq/sbt-docker:latest
commands:
- sbt -mem 1024 -Djline.terminal=off -Dcoursier.cache=./.coursier -Dsbt.ivy.home=./.ivy2 -Dfile.encoding=utf-8 -Dsbt.gigahorse=false test
environment:
DMP_TEAM_GITHUB_TOKEN:
from_secret: dmp_team_github_token
when:
event:
- push
- name: publish-artifacts-and-stage-image
pull: default
image: gwiq/sbt-docker:latest
commands:
- sbt -mem 1024 -Djline.terminal=off -Dcoursier.cache=./.coursier -Dsbt.ivy.home=./.ivy2 -Dfile.encoding=utf-8 +randagen-core/publish +randagen-app/docker:stage
environment:
DMP_TEAM_GITHUB_TOKEN:
from_secret: dmp_team_github_token
when:
event:
- promote
- tag
- name: rebuild-cache
pull: default
image: drillster/drone-volume-cache
settings:
mount:
- ./.ivy2
- ./.coursier
rebuild: true
volumes:
- name: cache
path: /cache
when:
event:
- push
- promote
- tag
- name: build-on-deploy
pull: default
image: docker:stable
commands:
- docker build -t local/randagen-app:$DRONE_COMMIT_SHA app/target/docker/stage
- "docker login -u \"$DOCKER_USER\" -p \"$DOCKER_PASSWORD\""
- docker tag local/randagen-app:$DRONE_COMMIT_SHA $IMAGE_NAME:$DRONE_COMMIT_SHA
- docker push $IMAGE_NAME:$DRONE_COMMIT_SHA
environment:
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_user
IMAGE_NAME: gwiq/randagen-app
volumes:
- name: docker.sock
path: /var/run/docker.sock
- name: docker
path: /root/.docker
when:
event:
- promote
- name: build-on-tag
pull: default
image: docker:stable
commands:
- docker build -t local/randagen-app:$RELEASE app/target/docker/stage
- "docker login -u \"$DOCKER_USER\" -p \"$DOCKER_PASSWORD\""
- docker tag local/randagen-app:$RELEASE $IMAGE_NAME:$RELEASE
- docker push $IMAGE_NAME:$RELEASE
environment:
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_user
IMAGE_NAME: gwiq/randagen-app
RELEASE: "${DRONE_TAG##v}"
volumes:
- name: docker.sock
path: /var/run/docker.sock
- name: docker
path: /root/.docker
when:
branch:
- master
event:
- tag
volumes:
- name: cache
host:
path: /tmp/cache
- name: docker.sock
host:
path: /var/run/docker.sock
- name: docker
host:
path: /root/.docker