-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
121 lines (105 loc) · 2.14 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
name: default
kind: pipeline
type: docker
platform:
os: linux
arch: amd64
steps:
- name: test-backend
depends_on: [ clone ]
image: openjdk:11-jdk-slim
commands:
- cd ./api
- ./mvnw clean install
- ./mvnw test -P it
- name: test-frontend
depends_on: [ clone ]
image: mhart/alpine-node:12.18.4
commands:
- cd ./ui
- npm install
- npm run-script lint
- npm test -- --watchAll=false
services:
- name: db
image: postgres:13-alpine
environment:
POSTGRES_DB: kimosabe
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
- name: redis
image: redislabs/redisearch:latest
- name: populate-redis
image: 6rotom/igdb-pdt:latest
environment:
REDIS_HOST: redis
- name: mailhog
image: mailhog/mailhog:latest
trigger:
branch:
- master
event:
- pull_request
---
name: deploy-dev
kind: pipeline
type: docker
platform:
os: linux
arch: amd64
steps:
- name: build-backend
depends_on: [ clone ]
image: openjdk:11-jdk-slim
commands:
- mkdir -p target
- cd ./api
- ./mvnw clean install
- cp ./target/*.jar ../target
- cp ../ssh-compose.yml ../target
- name: build-frontend
depends_on: [ clone ]
image: mhart/alpine-node:12.18.4
commands:
- mkdir -p target
- cd ./ui
- npm install
- npm run-script build
- cp -r ./build ../target
- name: deploy
image: appleboy/drone-scp
depends_on: [ build-frontend, build-backend ]
settings:
host:
from_secret: host_address
username:
from_secret: username
key:
from_secret: ssh_key
port: 22
target: /var/www/kimosabe
source: target
- name: run
image: appleboy/drone-ssh
depends_on: [ deploy ]
settings:
host:
from_secret: host_address
username:
from_secret: username
key:
from_secret: ssh_key
port: 22
script:
- sudo systemctl stop kimosabe-api.service
- cd /var/www/kimosabe/target
- docker-compose -f ssh-compose.yml down
- docker-compose -f ssh-compose.yml pull
- docker-compose -f ssh-compose.yml up -d
- sudo systemctl restart kimosabe-api.service
- echo "env updated $(date)" >> ~/drone-pipe
trigger:
branch:
- master
event:
- push