forked from umputun/remark42
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
105 lines (97 loc) · 2.56 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
kind: pipeline
name: default
type: docker
steps:
- name: build server
image: umputun/baseimage:buildgo-latest
commands:
- cd backend/app
- go build -mod=vendor
- echo "build completed"
- name: docker master
image: plugins/docker
settings:
repo: umputun/remark42
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- DRONE=${DRONE}
- DRONE_TAG=${DRONE_TAG}
- DRONE_COMMIT=${DRONE_COMMIT}
- DRONE_BRANCH=${DRONE_BRANCH}
tags:
- ${DRONE_COMMIT_BRANCH/\//-}
when:
branch: [master]
event: push
- name: docker tag
image: plugins/docker
settings:
repo: umputun/remark42
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- DRONE=${DRONE}
- DRONE_TAG=${DRONE_TAG}
- DRONE_COMMIT=${DRONE_COMMIT}
tags:
- ${DRONE_TAG}
- latest
when:
event: tag
- name: docker branch
image: plugins/docker
settings:
repo: umputun/remark42
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- DRONE=${DRONE}
- DRONE_COMMIT=${DRONE_COMMIT}
- DRONE_BRANCH=${DRONE_BRANCH}
tags:
- ${DRONE_COMMIT_BRANCH/\//-}
dry_run: true
when:
branch:
exclude: [master, release/*]
event: push
- name: artifacts tag
image: plugins/docker
settings:
dockerfile: Dockerfile.artifacts
build_args:
- DRONE=${DRONE}
- DRONE_TAG=${DRONE_TAG}
- DRONE_COMMIT=${DRONE_COMMIT}
- GITHUB_TOKEN=${GITHUB_TOKEN}
when:
event: tag
- name: deploy
image: docker.umputun.com/system/deploy-ci:master
commands:
- ssh [email protected] "cd /srv/remark && docker-compose pull"
- ssh [email protected] "cd /srv/remark && docker-compose up -d"
- ssh [email protected] "cd /srv/remark-site && git pull && git submodule update --recursive --remote"
- ssh [email protected] "cd /srv/remark-site && docker-compose build && docker-compose up"
when:
branch: master
event: push
- name: notify
image: drillster/drone-email
settings:
host: smtp.mailgun.org
username:
from_secret: email_username
password:
from_secret: email_password
from: [email protected]
recipients: [ [email protected] ]
when:
status: [ changed, failure ]