-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
105 lines (90 loc) · 2.18 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
kind: pipeline
type: docker
name: build-latest
trigger:
branch:
- master
steps:
- name: Build Docker
image: plugins/docker
settings:
repo: docker-registry.k8s.array21.dev/mrfriendly-crmquery-api
tags:
- latest
registry: docker-registry.k8s.array21.dev
- name: Slack notifications
image: plugins/slack
settings:
webhook:
from_secret: discord_webhook
username: Drone CI/CD - MrFriendly CRMQuery API - build-latest
when:
status: [ failure ]
---
kind: pipeline
type: docker
name: build-release
trigger:
event:
- tag
steps:
- name: Build Docker
image: plugins/docker
settings:
repo: docker-registry.k8s.array21.dev/mrfriendly-crmquery-api
registry: docker-registry.k8s.array21.dev
tags:
- ${DRONE_TAG}
- latest
- name: Deploy to Kubernetes
image: ubuntu:latest
environment:
DEBIAN_FRONTEND: noninteractive
SSH_KEY:
from_secret: ssh_key
commands:
- apt update && apt install -y openssh-client
- mkdir -p $HOME/.ssh/
- eval `ssh-agent`
- echo "$SSH_KEY" | tr -d '\r' | ssh-add - > /dev/null
- rm -rf $HOME/.ssh/config
- touch $HOME/.ssh/config
- echo "Host *\n\tStrictHostKeyChecking no" > $HOME/.ssh/config
- "ssh [email protected] kubectl set image -n mrfriendly deployment/crmquery api=docker-registry.k8s.array21.dev/mrfriendly-crmquery-api:${DRONE_TAG}"
- name: Slack notifications
image: plugins/slack
settings:
webhook:
from_secret: discord_webhook
username: Drone CI/CD - MrFriendly CRMQuery API - build-release
when:
status: [ failure ]
---
kind: pipeline
type: docker
name: test
steps:
- name: Cargo
image: docker-registry.k8s.array21.dev/rust-base
commands:
- cargo test
---
kind: pipeline
type: docker
name: clippy
steps:
- name: clippy
image: docker-registry.k8s.array21.dev/rust-base
environment:
RUSTFLAGS: '-Dwarnings'
commands:
- cargo clippy
---
kind: pipeline
type: docker
name: fmt
steps:
- name: fmt
image: docker-registry.k8s.array21.dev/rust-base
commands:
- 'cargo fmt --all -- --check'