Skip to content

Commit

Permalink
[mariadb-run-script] Add flag for gzipped inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
drmalex07 committed Apr 18, 2024
1 parent d93dca0 commit de6f61a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mariadb-run-script/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: "10.11"
description: Run an SQL script on a MariaDB database
name: mariadb-run-script
type: application
version: 0.2.0
version: 0.3.0
5 changes: 5 additions & 0 deletions mariadb-run-script/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,13 @@ spec:
- -xue
- -c
{{- if .Values.runScript.inputFile }}
{{- if .Values.runScript.inputFile.gzipped }}
- |-
gzip -d -c ${INPUT_FILE} | mariadb -Bv --database=${DB_NAME}
{{- else }}
- |-
mariadb -Bv --database=${DB_NAME} < ${INPUT_FILE}
{{- end }}{{/* if .Values.runScript.inputFile.gzipped */}}
{{- else }}
- |-
mariadb -Bv --database=${DB_NAME} --execute="${INPUT_SQL}"
Expand Down
1 change: 1 addition & 0 deletions mariadb-run-script/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ runScript:
# pvcName: scripts
# subPath: ~
# filePath: 1.sql
# gzipped: false
database:
name: example
host: mariadb
Expand Down

0 comments on commit de6f61a

Please sign in to comment.