forked from eclipse-tractusx/managed-identity-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): make chart standalone runnable
Signed-off-by: Dominik Pinsel <[email protected]>
- Loading branch information
1 parent
ae807e3
commit be182e9
Showing
7 changed files
with
231 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 0 additions & 56 deletions
56
charts/managed-identity-wallet/templates/backup/cronjob.yaml
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
charts/managed-identity-wallet/templates/backup/persistentvolumeclaim.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
charts/managed-identity-wallet/templates/job-keycloak-db.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{{- if .Values.keycloak.enabled }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ .Release.Name }}-job-create-db-keycloak | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: create-db | ||
image: postgres:13 | ||
env: | ||
- name: USER | ||
value: {{ tpl ( .Values.keycloak.externalDatabase.user | quote ) . }} | ||
- name: PGPASSWORD | ||
value: {{ tpl ( .Values.keycloak.externalDatabase.password | quote ) . }} | ||
- name: HOST | ||
value: {{ tpl ( .Values.keycloak.externalDatabase.host | quote ) . }} | ||
- name: PORT | ||
value: {{ tpl ( .Values.keycloak.externalDatabase.port | quote ) . }} | ||
- name: DATABASE | ||
value: {{ tpl ( .Values.keycloak.externalDatabase.database | quote ) . }} | ||
command: [ "bash", "-c", "--" ] | ||
args: | ||
- | | ||
echo "Postgres user: $USER" | ||
echo "Postgres host: $HOST" | ||
echo "Postgres port: $PORT" | ||
echo "Postgres database: $DATABASE" | ||
echo "Waiting for postgres to start" | ||
while ! psql -h $HOST -p $PORT -U $USER -d postgres -c "select 1" > /dev/null 2>&1; do | ||
sleep 1 | ||
done | ||
echo "Creating database $DATABASE" | ||
psql -h $HOST -p $PORT -U $USER -d postgres -c "CREATE DATABASE $DATABASE" > /dev/null 2>&1 || echo "Skip creation as database $DATABASE already exists" | ||
securityContext: {{ .Values.jobSecurityContext | toYaml | nindent 12 }} | ||
restartPolicy: Never | ||
backoffLimit: 0 | ||
--- | ||
{{- end}} # end if .Values.keycloak.enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ .Release.Name }}-job-create-db-miw | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: create-db | ||
image: postgres:13 | ||
env: | ||
- name: USER | ||
value: {{ tpl ( .Values.miw.database.user | quote ) . }} | ||
- name: PGPASSWORD | ||
value: {{ tpl ( .Values.miw.database.password | quote ) . }} | ||
- name: HOST | ||
value: {{ tpl ( .Values.miw.database.host | quote ) . }} | ||
- name: PORT | ||
value: {{ tpl ( .Values.miw.database.port | quote ) . }} | ||
- name: DATABASE | ||
value: {{ tpl ( .Values.miw.database.database | quote ) . }} | ||
command: [ "bash", "-c", "--" ] | ||
args: | ||
- | | ||
echo "Postgres user: $USER" | ||
echo "Postgres host: $HOST" | ||
echo "Postgres port: $PORT" | ||
echo "Postgres database: $DATABASE" | ||
echo "Waiting for postgres to start" | ||
while ! psql -h $HOST -p $PORT -U $USER -d postgres -c "select 1" > /dev/null 2>&1; do | ||
sleep 1 | ||
done | ||
echo "Creating database $DATABASE" | ||
psql -h $HOST -p $PORT -U $USER -d postgres -c "CREATE DATABASE $DATABASE" > /dev/null 2>&1 || echo "Skip creation as database $DATABASE already exists" | ||
securityContext: {{ .Values.jobSecurityContext | toYaml | nindent 12 }} | ||
restartPolicy: Never | ||
backoffLimit: 0 |
Oops, something went wrong.