/
.drone.yml
55 lines (47 loc) · 988 Bytes
/
.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
---
kind: pipeline
name: run_tests
type: docker
steps:
- name: seed
image: postgres:15-alpine
commands:
- psql -h localhost -U test < ./database/seed/1.create_types.sql
- psql -h localhost -U test < ./database/seed/2.struct.sql
- name: test
image: golang:1.19
commands:
- go test ./...
services:
# This database stays running during the whole pipeline and can be accessed from any of the
# other steps.
- name: lymantria_test
image: postgres:15-alpine
ports:
- 5432
environment:
POSTGRES_DB: lymantria_test
POSTGRES_PASSWORD: test-pass
POSTGRES_USER: test
trigger:
branch:
- main
---
kind: pipeline
name: deploy
type: ssh
depends_on:
- run_tests
server:
host:
from_secret: ssh_host
user:
from_secret: ssh_username
ssh_key:
from_secret: ssh_key
steps:
- name: deploy
commands:
- cd /home/docker/lymantria-api
- git pull --rebase
- docker-compose up -d