-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
executable file
·124 lines (105 loc) · 2.27 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
---
kind: pipeline
name: default
steps:
- name: sync_push
image: alpine/git:1.0.7
environment:
REPO_REMOTE: https://github.com/fewensa/vtom-vertx.git
volumes:
- name: git_credentials
path: /root/.git-credentials
- name: git_config
path: /root/.gitconfig
when:
event:
- push
commands:
- git remote add github $REPO_REMOTE
- git push github $DRONE_BRANCH
- name: sync_tag
image: alpine/git:1.0.7
environment:
REPO_REMOTE: https://github.com/fewensa/vtom-vertx.git
volumes:
- name: git_credentials
path: /root/.git-credentials
- name: git_config
path: /root/.gitconfig
when:
event:
- tag
commands:
- git remote add github $REPO_REMOTE
- git fetch origin
- git push github $DRONE_TAG
volumes:
- name: git_credentials
host:
path: /data/mount/git/.git-credentials
- name: git_config
host:
path: /data/mount/git/.gitconfig
---
kind: pipeline
name: deploy
steps:
- name: pg_setup
image: postgres:11-alpine
environment:
PGPASSWORD: passwd
commands:
- sleep 3
- psql -U postgres -d vtom -h database -f /drone/src/vtom-test/src/test/resources/schema/vtom.sql
- name: deploy
image: maven:3.6-alpine
volumes:
- name: m2
path: /root/.m2
- name: gpg
path: /root/.gnupg
environment:
DB_URL: jdbc:postgresql://database:5432/vtom
DB_USER: postgres
DB_PASSWD: passwd
REDIS_HOST: redis
commands:
- apk add gnupg
- mvn clean deploy -Prelease
volumes:
- name: m2
host:
path: /data/mount/m2
- name: gpg
host:
path: /data/gnupg
services:
- name: database
image: postgres:11-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_DB: vtom
POSTGRES_PASSWORD: passwd
- name: redis
image: redis:4-alpine
trigger:
event:
- tag
---
kind: pipeline
name: install
steps:
- name: install
image: maven:3.6-alpine
volumes:
- name: m2
path: /root/.m2
commands:
- mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dgpg.skip=true
volumes:
- name: m2
host:
path: /data/mount/m2
trigger:
event:
- push