Skip to content

Commit

Permalink
also allow updating st2chatops external-scripts.json file
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Jun 26, 2021
1 parent 2824650 commit f867681
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
20 changes: 20 additions & 0 deletions templates/configmaps_hubot-external-scripts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-st2chatops-hubot-external-scripts
annotations:
description: Custom Hubot external script registration in '/opt/stackstorm/chatops/external-scripts.json'
labels:
app: st2
tier: backend
vendor: stackstorm
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{/* keep this list synchronized with https://github.com/StackStorm/st2chatops/blob/master/external-scripts.json */}}
{{- $st2chatopsExternalScripts := list "hubot-stackstorm" "hubot-help" }}
{{- $customExternalScripts := .Values.st2chatops.hubotExternalScripts | default (list) }}
external-scripts.json: |
{{ toPrettyJson (concat $customExternalScripts $st2chatopsExternalScripts) | indent 4 }}
16 changes: 15 additions & 1 deletion templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1448,14 +1448,28 @@ spec:
{{- if .Values.st2chatops.serviceAccount.attach }}
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
{{- end }}
{{- if .Values.st2chatops.hubotScriptsVolume }}
{{- if or .Values.st2chatops.hubotScriptsVolume .Values.st2chatops.hubotExternalScripts }}
volumeMounts:
{{- if .Values.st2chatops.hubotScriptsVolume }}
- name: st2-chatops-hubot-scripts-vol
mountPath: /opt/stackstorm/chatops/scripts
{{- end }}
{{- if .Values.st2chatops.hubotExternalScripts }}
- name: st2-chatops-hubot-external-scripts-vol
mountPath: /opt/stackstorm/chatops/external-scripts.json
subPath: external-scripts.json
{{- end }}
volumes:
{{- if .Values.st2chatops.hubotScriptsVolume }}
- name: st2-chatops-hubot-scripts-vol
{{- toYaml .Values.st2chatops.hubotScriptsVolume | nindent 10 }}
{{- end }}
{{- if .Values.st2chatops.hubotExternalScripts }}
- name: st2-chatops-hubot-external-scripts-vol
configMap:
name: {{ .Release.Name }}-st2chatops-hubot-external-scripts
{{- end }}
{{- end }}
{{- with .Values.st2chatops.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
Expand Down
6 changes: 6 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,12 @@ st2chatops:
# Most installations should not use this.
# For details on writing .js or .coffeescript hubot extensions, see: https://hubot.github.com/docs/scripting/
hubotScriptsVolume: {}
# You can also use pre-made external scripts to customize your hubot, such as those at https://github.com/hubot-scripts
# You will need to provide a custom container with such scripts installed in /opt/stackstorm/chatops
# and then register them here:
hubotExternalScripts: []
# for example, to enable hubot-http-status (https://github.com/hubot-scripts/hubot-http-status):
# - hubot-http-status
# Additional advanced settings to control pod/deployment placement
nodeSelector: {}
tolerations: []
Expand Down

0 comments on commit f867681

Please sign in to comment.