forked from smarkets/marge-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yml
93 lines (93 loc) · 2.45 KB
/
deploy.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
---
kind: "Template"
apiVersion: "v1"
metadata:
name: "marge-ephemeral"
annotations:
description: "Provides a marge template"
labels:
template: "marge template"
objects:
- kind: Secret
apiVersion: v1
metadata:
namespace: "$(KUBE_NAMESPACE)"
name: marge-secrets
type: Opaque
data:
MARGE_AUTH_TOKEN: "$(MARGE_AUTH_TOKEN)"
MARGE_SSH_KEY: "$(MARGE_SSH_KEY)"
- kind: Deployment
apiVersion: apps/v1
metadata:
name: "$(APP_NAME)"
namespace: "$(KUBE_NAMESPACE)"
labels:
k8s-app: "$(APP_NAME)"
spec:
replicas: "$((REPLICA_COUNT))"
selector:
matchLabels:
k8s-app: "$(APP_NAME)"
template:
metadata:
labels:
k8s-app: "$(APP_NAME)"
spec:
serviceAccountName: default
containers:
- name: app
image: "$(APP_IMAGE)"
imagePullPolicy: Always
args: ["--gitlab-url=$(MARGE_GITLAB_URL)",
"--impersonate-approvers",
"--add-tested",
"--add-reviewers",
"--add-part-of"]
env:
- name: MARGE_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: marge-secrets
key: MARGE_AUTH_TOKEN
- name: MARGE_SSH_KEY
valueFrom:
secretKeyRef:
name: marge-secrets
key: MARGE_SSH_KEY
parameters:
- name: "APP_NAME"
description: "Name of the app"
value: "marge-bot"
required: true
parameterType: "string"
- name: "APP_IMAGE"
description: "App image name to run"
value: "smarkets/marge-bot"
required: true
parameterType: "string"
- name: "KUBE_NAMESPACE"
description: "Kube namespace"
value: "marge"
required: true
parameterType: "string"
- name: "REPLICA_COUNT"
description: "Number of replicas to run"
value: 1
required: true
parameterType: "int"
- name: "MARGE_GITLAB_URL"
description: "Marge GitLab url"
value: "http://your.gitlab.instance.com"
required: true
parameterType: "string"
- name: "MARGE_AUTH_TOKEN"
description: "Marge GitLab auth token"
value: 0
required: true
parameterType: "base64"
- name: "MARGE_SSH_KEY"
description: "Marge GitLab rsa key"
value: 0
required: true
parameterType: "base64"