Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions charts/gateway/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,37 @@ data:
copy "custom properties" ".properties" $CUSTOM_PROPERTIES_DIR $TARGET_CUSTOM_PROPERTIES_DIR
copy "custom health checks" ".sh" $CUSTOM_HEALTHCHECK_SCRIPTS_DIR $TARGET_HEALTHCHECK_DIR
run "custom shell scripts" ".sh" $CUSTOM_SHELL_SCRIPTS_DIR
003-parse-init: |-
#!/bin/bash
BASE_CONFIG_DIR="/opt/docker/custom"
CUSTOM_SHELL_SCRIPTS_DIR="$BASE_CONFIG_DIR/init-scripts"

error() {
# Send errors to stderr in case these get handled differently by the container PaaS on which this runs
echo "ERROR - ${1}" 1>&2
exit 1
}

function run() {
TYPE=$1
EXT=$2
SOURCE_DIR=$3
echo "***************************************************************************"
echo "scanning for $TYPE in $SOURCE_DIR"
echo "***************************************************************************"
FILES=$(du -a $3 | grep -e ".\\$2$" | awk '{ print $2 }' 2>/dev/null)
for file in $FILES; do
name=$(basename "$file")
echo -e "running $name"
/bin/bash $file
if [ $? -ne 0 ]; then
echo "Failed executing the script: $file"
exit 1
fi
done
}

run "custom init shell scripts" ".sh" $CUSTOM_SHELL_SCRIPTS_DIR
{{- end}}
{{- if .Values.preStopScript.enabled }}
gracefulshutdown: |-
Expand Down
9 changes: 9 additions & 0 deletions charts/gateway/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ spec:
- name: {{ template "gateway.fullname" . }}-parse-custom-files-script
mountPath: /opt/docker/rc.d/003-parse-custom-files.sh
subPath: 003-parse-custom-files.sh
- name: {{ template "gateway.fullname" . }}-parse-init-script
mountPath: /opt/docker/init.d/003-parse-init.sh
subPath: 003-parse-init.sh
{{- end }}
{{- end }}
{{- if .Values.preStopScript }}
Expand Down Expand Up @@ -552,6 +555,12 @@ spec:
items:
- key: 003-parse-custom-files
path: 003-parse-custom-files.sh
- name: {{ template "gateway.fullname" . }}-parse-init-script
configMap:
name: {{ template "gateway.fullname" . }}-configmap
items:
- key: 003-parse-init
path: 003-parse-init.sh
{{- end }}
{{- end }}
{{- if .Values.preStopScript }}
Expand Down