Skip to content

Commit

Permalink
feat(portalmigrations): enable seeding of test data with configmap (#356
Browse files Browse the repository at this point in the history
)

enable seeding of test data with configmap and move default seeding path and processidentity userid out of values file, into job, as changing those values isn't intuitive
  • Loading branch information
evegufy authored Jul 10, 2024
1 parent e74f0a7 commit 84375bb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
20 changes: 18 additions & 2 deletions charts/portal/templates/job-backend-portal-migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,30 @@ spec:
- name: "SEEDING__TESTDATAENVIRONMENTS__0"
value: "{{ .Values.backend.portalmigrations.seeding.testDataEnvironments }}"
- name: "SEEDING__DATAPATHS__0"
value: "{{ .Values.backend.portalmigrations.seeding.testDataPaths }}"
value: "Seeder/Data"
- name: "SERILOG__MINIMUMLEVEL__Default"
value: "{{ .Values.backend.portalmigrations.logging.default }}"
- name: "PROCESSIDENTITY__PROCESSUSERID"
value: "{{ .Values.backend.portalmigrations.processIdentity.processUserId }}"
value: "d21d2e8a-fe35-483c-b2b8-4100ed7f0953"
{{- if and (.Values.backend.portalmigrations.seeding.testData.configMap) (.Values.backend.portalmigrations.seeding.testData.filename) }}
- name: "SEEDING__DATAPATHS__1"
value: "Seeder/Data/import"
- name: "SEEDING__TESTDATAENVIRONMENTS__1"
value: "{{ .Values.backend.portalmigrations.seeding.testData.filename }}"
{{- end }}
ports:
- name: http
containerPort: {{ .Values.portContainer }}
protocol: TCP
resources:
{{- toYaml .Values.backend.portalmigrations.resources | nindent 10 }}
{{- if and (.Values.backend.portalmigrations.seeding.testData.configMap) (.Values.backend.portalmigrations.seeding.testData.filename) }}
volumeMounts:
- name: test-data
mountPath: /migrations/Seeder/Data/import
volumes:
- name: test-data
configMap:
name: "{{ .Values.backend.portalmigrations.seeding.testData.configMap }}"
optional: true
{{- end }}
11 changes: 6 additions & 5 deletions charts/portal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,12 @@ backend:
memory: 350M
seeding:
testDataEnvironments: ""
# -- when changing the testDataPath the processIdentity needs to be adjusted as well,
# or it must be ensured that the identity is existing within the files under the new path
testDataPaths: "Seeder/Data"
processIdentity:
processUserId: d21d2e8a-fe35-483c-b2b8-4100ed7f0953
# -- Option to seed test data provided in a configMap
testData:
# -- ConfigMap containing json files for the tables to seed, e.g. companies.test.json, addresses.test.json, etc.
configMap: ""
# -- Filename identifying the test data files e.g. for companies.test.json the value would be "test"
filename: ""
logging:
default: "Information"
portalmaintenance:
Expand Down

0 comments on commit 84375bb

Please sign in to comment.