Skip to content

Commit bf885e7

Browse files
authored
Support multiple bot instances (#77)
* Adds support for disabling modules * Adds new instance * Update local values * Bump Chart Version
1 parent c85893d commit bf885e7

File tree

8 files changed

+542
-449
lines changed

8 files changed

+542
-449
lines changed

helm/citsbot/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v2
22
description: UWA CSDS Discord Bot
33
name: citsbot
4-
version: 1.15.0
4+
version: 1.16.0

helm/citsbot/templates/deployment.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1+
{{- range $key, $instance := .Values.instances -}}
12
apiVersion: apps/v1
23
kind: Deployment
34
metadata:
4-
name: {{ $.Chart.Name }}
5+
name: "{{ $.Chart.Name }}-{{ $instance.name }}"
56
spec:
67
strategy:
78
type: Recreate
89
replicas: 1
910
selector:
1011
matchLabels:
11-
app: citsbot
12+
app: "{{ $.Chart.Name }}-{{ $instance.name }}"
1213
template:
1314
metadata:
1415
labels:
15-
app: citsbot
16+
app: "{{ $.Chart.Name }}-{{ $instance.name }}"
1617
spec:
1718
containers:
1819
- name: citsbot
@@ -31,5 +32,7 @@ spec:
3132
name: citsbot.config
3233
key: imgurClientId
3334
- name: CONFIG
34-
value: {{ .Values.botConfig | toJson | quote }}
35+
value: {{ $instance.botConfig | toJson | quote }}
3536
terminationGracePeriodSeconds: 5
37+
---
38+
{{- end }}

helm/citsbot/templates/secrets.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
{{- range $i, $secret := .Values.secrets -}}
1+
{{- range $key, $instance := .Values.instances -}}
2+
{{- range $i, $secret := $instance.secrets -}}
23
apiVersion: kubernetes-client.io/v1
34
kind: ExternalSecret
45
metadata:
5-
name: "{{ $secret.name }}"
6+
name: "{{ $instance.name }}-{{ $secret.name }}"
67
spec:
78
backendType: systemManager
89
data:
@@ -18,6 +19,7 @@ spec:
1819
{{ end }}
1920
---
2021
{{- end }}
22+
{{- end }}
2123
{{ if .Values.localSecrets -}}
2224
apiVersion: v1
2325
kind: Secret

helm/citsbot/values.local.yaml

Lines changed: 62 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,64 +4,67 @@ localSecrets:
44
token: placeholder
55
imgurClientId: placeholder
66

7-
botConfig:
8-
prefix: "!"
9-
guild: '702939230783012867'
10-
logChannel: '702939231785320519'
11-
units:
12-
TEST1001:
13-
name: Test Unit 1
14-
role: '772773357568786452'
15-
channels:
16-
general: '702939234893299742'
17-
resources: '702939234893299743'
18-
TEST2002:
19-
name: Test Unit 2
20-
role: '772773360081174558'
21-
channels:
22-
general: '702939234893299745'
23-
resources: '702939234893299747'
24-
modules:
25-
cowsay:
26-
lineMaxLen: 40
27-
cowArt: |
7+
instances:
8+
- name: uwacsds
9+
secrets: []
10+
botConfig:
11+
prefix: "!"
12+
guild: '702939230783012867'
13+
logChannel: '702939231785320519'
14+
units:
15+
TEST1001:
16+
name: Test Unit 1
17+
role: '772773357568786452'
18+
channels:
19+
general: '702939234893299742'
20+
resources: '702939234893299743'
21+
TEST2002:
22+
name: Test Unit 2
23+
role: '772773360081174558'
24+
channels:
25+
general: '702939234893299745'
26+
resources: '702939234893299747'
27+
modules:
28+
cowsay:
29+
lineMaxLen: 40
30+
cowArt: |
2831
29-
\ ^__^
30-
\ (oo)\_______
31-
(__)\ )\/\
32-
||----w |
33-
|| ||
34-
welcomer:
35-
channel: '702939230996922382'
36-
newMemberDm:
37-
delay: 10000
38-
roleThreshold: 1
39-
instantAccountAge: 7
40-
message: |-
41-
Hey {name}, welcome to the UWA Computer and Data Science discord server! I noticed that you haven't selected any roles yet. To gain access to unit channels you need to react to the messages in #overview.
32+
\ ^__^
33+
\ (oo)\_______
34+
(__)\ )\/\
35+
||----w |
36+
|| ||
37+
welcomer:
38+
channel: '702939230996922382'
39+
newMemberDm:
40+
delay: 10000
41+
roleThreshold: 1
42+
instantAccountAge: 7
43+
message: |-
44+
Hey {name}, welcome to the UWA Computer and Data Science discord server! I noticed that you haven't selected any roles yet. To gain access to unit channels you need to react to the messages in #overview.
4245
43-
Have a read of the rules and click the emoji reactions for the unit channels you want to see. https://i.imgur.com/W2CHMEM.gif
44-
announcer:
45-
channel: '702939230996922381'
46-
crontab: 0 0 * * mon
47-
disclaimer: "⚠️ This information is provided as a guide only and may be incomplete
48-
and/or inaccurate. Please consult official UWA sources. Do not rely solely on
49-
this list."
50-
image: https://i.imgur.com/2cQttpX.png
51-
colour: "#2598d9"
52-
reactRoles:
53-
messages:
54-
- id: '772772517656002570'
55-
channel: '702939230996922380'
56-
reactions:
57-
- role: '705800518517391378'
58-
emoji: github
59-
- unit: TEST1001
60-
emoji: bluej
61-
- unit: TEST2002
62-
emoji: "\U0001F4DD"
63-
animeDetector:
64-
keywords:
65-
- anime
66-
- manga
67-
keywordCountThreshold: 5
46+
Have a read of the rules and click the emoji reactions for the unit channels you want to see. https://i.imgur.com/W2CHMEM.gif
47+
announcer:
48+
channel: '702939230996922381'
49+
crontab: 0 0 * * mon
50+
disclaimer: "⚠️ This information is provided as a guide only and may be incomplete
51+
and/or inaccurate. Please consult official UWA sources. Do not rely solely on
52+
this list."
53+
image: https://i.imgur.com/2cQttpX.png
54+
colour: "#2598d9"
55+
reactRoles:
56+
messages:
57+
- id: '772772517656002570'
58+
channel: '702939230996922380'
59+
reactions:
60+
- role: '705800518517391378'
61+
emoji: github
62+
- unit: TEST1001
63+
emoji: bluej
64+
- unit: TEST2002
65+
emoji: "\U0001F4DD"
66+
animeDetector:
67+
keywords:
68+
- anime
69+
- manga
70+
keywordCountThreshold: 5

0 commit comments

Comments
 (0)