-
Notifications
You must be signed in to change notification settings - Fork 13
/
.drone.yml
66 lines (60 loc) · 1.49 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
workspace:
base: /go
path: src/github.com/Multy-io/Multy-back
pipeline:
build:
image: golang:1.9.2
commands:
- git checkout master
- make build
publish-master:
image: plugins/docker
repo: multyio/backend
tags:
- 1.0.8
- master
secrets: [ docker_username, docker_password ]
when:
branch: master
ssh-master:
image: appleboy/drone-ssh
host: 88.198.47.112
username: multy
secrets: [ ssh_password ]
script:
- cd /data2/home/multy/prod/
- docker-compose -f docker-compose-prod.yml stop
- docker pull multyio/backend:master
- docker-compose -f docker-compose-prod.yml up -d
when:
branch: master
publish-test:
image: plugins/docker
repo: multyio/backend-test
tags:
- latest
- 1.0.9
secrets: [ docker_username, docker_password ]
when:
branch: test2
ssh-test:
image: appleboy/drone-ssh
host: 88.198.47.112
username: multy
secrets: [ ssh_password ]
script:
- cd /data2/home/multy/test
- docker-compose -f docker-compose-test.yml stop
- docker pull multyio/backend-test:latest
- now=$(date +"%m_%d_%Y__%H_%M_%S")
- cd backend
- if [ -d logs ]; then mv logs logs_$now; fi
- cd ../
- docker-compose -f docker-compose-test.yml up -d
when:
branch: test2
telegram:
image: appleboy/drone-telegram
secrets: [ telegram_token, telegram_to ]
when:
status: [ success, failure ]