This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
107 lines (91 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
kind: pipeline
type: docker
name: build-latest
trigger:
branch:
- master
steps:
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
- name: Build Docker
image: plugins/docker
settings:
repo: docker-registry.k8s.array21.dev/mrfriendly-mailsync
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 MailSync - build-latest
when:
status: [ failure ]
---
kind: pipeline
type: docker
name: build-release
trigger:
event:
- tag
steps:
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
- name: Build Docker
image: plugins/docker
settings:
repo: docker-registry.k8s.array21.dev/mrfriendly-mailsync
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 droneci@kube-ssh.intern.array21.dev kubectl set image -n mrfriendly deployment/mailsync mailsync=docker-registry.k8s.array21.dev/mrfriendly-mailsync:${DRONE_TAG}"
- name: Slack notifications
image: plugins/slack
settings:
webhook:
from_secret: discord_webhook
username: Drone CI/CD - MrFriendly MailSync - build-release
when:
status: [ failure ]
---
kind: pipeline
type: docker
name: build-and-test
trigger:
event:
- pull_request
- push
steps:
- name: Cargo
image: rust:1.56.1-bullseye
commands:
- cargo build
- cargo test
- name: Slack notifications
image: plugins/slack
settings:
webhook:
from_secret: discord_webhook
username: Drone CI/CD - MrFriendly MailSync - build-and-test
when:
status: [ failure ]