-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
65 lines (64 loc) · 1.76 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
kind: pipeline
name: default
steps:
- name: backends
image: golang:1.16
commands:
- export GOPROXY=https://athens.bsprague.com
- GOOS=linux go build -ldflags '-extldflags "-static" -s -w' -o cmd/codenames-server/server github.com/bcspragu/Codenames/cmd/codenames-server
- CGO_ENABLED=0 GOOS=linux go build -ldflags '-extldflags "-static" -s -w' -o cmd/ai-server/server github.com/bcspragu/Codenames/cmd/ai-server
- go test ./...
- name: frontend
image: plugins/docker
settings:
repo: docker.bsprague.com/codenames-frontend
registry: docker.bsprague.com
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: web/frontend/Dockerfile
context: web/frontend/
- name: docker-backend
image: plugins/docker
settings:
repo: docker.bsprague.com/codenames
registry: docker.bsprague.com
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: cmd/codenames-server/Dockerfile
context: cmd/codenames-server/
when:
branch:
- master
- name: docker-ai-backend
image: plugins/docker
settings:
repo: docker.bsprague.com/codenames-ai
registry: docker.bsprague.com
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: cmd/ai-server/Dockerfile
context: cmd/ai-server/
when:
branch:
- master
- name: ssh
image: appleboy/drone-ssh
settings:
host: prod.bsprague.com
username:
from_secret: ssh_username
key:
from_secret: ssh_key
script:
- sudo systemctl restart codenames.service
- sudo systemctl restart codenames-ai.service
- sudo systemctl restart codenames-frontend.service
when:
branch:
- master