This repository has been archived by the owner on Dec 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
131 lines (113 loc) · 3.17 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
121
122
123
124
125
126
127
128
129
130
131
---
kind: pipeline
name: default
platform:
os: linux
arch: amd64
steps:
- name: fmt
pull: default
image: patwie/goimports:v1
commands:
- "[ 0 -eq `goimports -l . | wc -l` ]"
- name: lint
image: golangci/golangci-lint:v1.16
pull: true
commands:
- golangci-lint run -D errcheck --deadline=10m
- name: build
pull: default
image: golang
commands:
- sed -i 's/"YXZ"/"${DRONE_COMMIT_SHA}"/g' symbol/version.go
- go version
- go build infomark.go
environment:
GOPROXY: https://gomods.patwie.com/
- name: ping_db
pull: default
image: postgres:11.2-alpine
commands:
- "until PGPASSWORD=postgres psql -U postgres -d infomark -h database \\\n -c \"SELECT 1;\" >/dev/null 2>&1; do sleep 1; done\n"
- "PGPASSWORD=postgres psql -U postgres -d infomark -h database \\\n -c \"SELECT * FROM pg_catalog.pg_tables;\"\n"
- name: ping_amqp
pull: default
image: rabbitmq:3.7.3-management-alpine
commands:
- "until wget --spider http://rabbitAMQP:15672 >/dev/null 2>&1; do sleep 1; done"
- name: ping_redis
pull: default
image: redis:5.0.4-alpine
commands:
- "until redis-cli -h redis_service ping >/dev/null 2>&1; do sleep 1; done"
- redis-cli -h redis_service FLUSHALL
- name: mock
pull: default
image: python:3
commands:
- cd database
- pip3 install -r requirements.txt
- python3 mock.py
- name: seed
pull: default
image: postgres:11.2-alpine
commands:
- cd database
- "PGPASSWORD=postgres psql -h 'database' -U 'postgres' -d 'infomark' -f schema.sql >/dev/null"
- "PGPASSWORD=postgres psql -h 'database' -U 'postgres' -d 'infomark' -f migrations/0.0.1alpha14.sql >/dev/null"
- "PGPASSWORD=postgres psql -h 'database' -U 'postgres' -d 'infomark' -f migrations/0.0.1alpha21.sql >/dev/null"
- "PGPASSWORD=postgres psql -h 'database' -U 'postgres' -d 'infomark' -f mock.sql >/dev/null"
- name: test
pull: default
image: golang
commands:
- cp .infomark.yml.ci .infomark.yml
- export INFOMARK_CONFIG_DIR=`pwd`
- go test ./... -cover -v --goblin.timeout 15s
environment:
GOPROXY: https://gomods.patwie.com/
- name: docs
pull: default
image: golang
commands:
- go generate
environment:
GOPROXY: https://gomods.patwie.com/
- name: create_release
pull: default
image: patwie/tar
commands:
- tar -czvf infomark-backend.tar.gz api.yaml infomark README.md LICENSE .infomark.example.yml docker-compose.example.yml database/schema.sql files/uploads/ files/generated_files/ files/common/ database/migrations
- name: publish_release
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- infomark-backend.tar.gz
checksum:
- md5
- sha256
when:
event: tag
services:
- name: database
pull: default
image: postgres:11.2-alpine
environment:
POSTGRES_DB: infomark
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
- name: rabbitAMQP
pull: default
image: rabbitmq:3.7.3-management-alpine
environment:
RABBITMQ_DEFAULT_PASS: password
RABBITMQ_DEFAULT_USER: user
- name: redis_service
pull: default
image: redis:5.0.4-alpine
---
kind: signature
hmac: f0c892d5528986846a3e67508c12f635049d74272546d69b64766d4de0dd8bce
...