-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
91 lines (87 loc) · 2.59 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
kind: pipeline
name: default
steps:
- name: initial_notification
image: plugins/slack
settings:
webhook:
from_secret: slack_webhook
template: >
Repository: *{{repo.name}}*. Status: *Running*. Author: *{{build.author}}*. Build: *#{{build.number}}*. Branch: *{{build.branch}}*. Event: *{{build.event}}*. Logs: {{build.link}}
- name: tests
image: node:12.14.0-alpine3.11
environment:
POSTGRESQL_HOST: database
POSTGRESQL_DB: snipsnap-test
POSTGRESQL_USERNAME: postgres
NODE_ENV: test
commands:
- npm install
- npm run lint
- npm run db:create
- npm run db:migrate
- npm run test
- name: build
image: plugins/docker
settings:
repo: registry.pixelpoint.io/snipsnap-api-prod
registry: registry.pixelpoint.io
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- NODE_ENV=production
when:
branch: master
event: push
- name: db_migrate
image: node:12.14.0-alpine3.11
commands:
- npm install
- npm run db:migrate
environment:
POSTGRESQL_PORT: 5432
POSTGRESQL_USERNAME:
from_secret: db_username_prod
POSTGRESQL_DB:
from_secret: db_name_prod
POSTGRESQL_PASSWORD:
from_secret: db_pass_prod
POSTGRESQL_HOST:
from_secret: db_host_prod
when:
event: push
branch: master
- name: deploy
image: peloton/drone-k8s-deployment
settings:
insecure: false
deployment_names: snipsnap-api-prod
container_names: snipsnap-api-prod
namespaces: snipsnap-prod
docker_image: registry.pixelpoint.io/snipsnap-api-prod:latest
date_label: deployment.drone.io/date-deployed
url:
from_secret: kubernetes_url
token:
from_secret: kubernetes_token
when:
branch: master
event: push
- name: build_status_notification
image: plugins/slack
settings:
webhook:
from_secret: slack_webhook
template: >
{{#success build.status}}
Repository: *{{repo.name}}*. Status: *Completed*. Author: *{{build.author}}*. Build: *#{{build.number}}*. Branch: *{{build.branch}}*. Event: *{{build.event}}*. Logs: {{build.link}}
{{else}}
Repository: *{{repo.name}}*. Status: *Failed*. Author: *{{build.author}}*. Build: *#{{build.number}}*. Branch: *{{build.branch}}*. Event: *{{build.event}}*. Logs: {{build.link}}
{{/success}}
when:
status: [success, failure]
services:
- name: database
image: postgres:12.1