Skip to content

Commit c308520

Browse files
committed
Use variables to specify scheduler job input files
1 parent cd23401 commit c308520

11 files changed

+120
-9
lines changed

charts/thub/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type: application
66
# This is the chart version. This version number should be incremented each time you make changes
77
# to the chart and its templates, including the app version.
88
# Versions are expected to follow Semantic Versioning (https://semver.org/)
9-
version: 1.7.2
9+
version: 1.7.3
1010

1111
# This is the version number of the application being deployed. This version number should be
1212
# incremented each time you make changes to the application. Versions are not expected to
@@ -23,7 +23,7 @@ dependencies:
2323
- name: keycloak-config
2424
version: 0.1.1
2525
- name: lms-data-service
26-
version: 1.5.0
26+
version: 1.5.1
2727
- name: ojt
2828
version: 1.4.13
2929
- name: user-service

charts/thub/charts/lms-data-service/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type: application
77
# This is the chart version. This version number should be incremented each time you make changes
88
# to the chart and its templates, including the app version.
99
# Versions are expected to follow Semantic Versioning (https://semver.org/)
10-
version: 1.5.0
10+
version: 1.5.1
1111

1212
# This is the version number of the application being deployed. This version number should be
1313
# incremented each time you make changes to the application. Versions are not expected to

charts/thub/charts/lms-data-service/templates/_helpers.tpl

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ Create the name of the CronJob assigned-items-scheduler-job
110110
{{ include "lms-data-service.name" . }}-assigned-items-scheduler-job
111111
{{- end }}
112112

113+
{{/*
114+
Create the name of the JSON file used by the assigned-items-scheduler-job
115+
*/}}
116+
{{- define "lms-data-service.assignedItemsSchedulerJobInputFile" -}}
117+
{{- if .Values.assignedItemsSchedulerJob.jsonInputFile -}}
118+
{{ print .Values.assignedItemsSchedulerJob.jsonInputFile }}
119+
{{- else -}}
120+
{{ print "./temp/start-assigned-items-job.json" }}
121+
{{- end }}
122+
{{- end }}
123+
113124
{{/*
114125
Create the name of the CronJob lms-end-incomplete-jobs-scheduler-job
115126
*/}}
@@ -124,23 +135,86 @@ Create the name of the CronJob instructors-scheduler-job
124135
{{ include "lms-data-service.name" . }}-instructors-scheduler-job
125136
{{- end }}
126137

138+
{{/*
139+
Create the name of the JSON file used by the instructors-scheduler-job
140+
*/}}
141+
{{- define "lms-data-service.instructorsSchedulerJobInputFile" -}}
142+
{{- if .Values.instructorsSchedulerJob.jsonInputFile -}}
143+
{{ print .Values.instructorsSchedulerJob.jsonInputFile }}
144+
{{- else if eq .Values.global.lmsType "WORKDAY" -}}
145+
{{ print "./temp/start-instructors-web-job.json" }}
146+
{{- else -}}
147+
{{ print "./temp/start-instructors-job.json" }}
148+
{{- end }}
149+
{{- end }}
150+
127151
{{/*
128152
Create the name of the CronJob items-scheduler-job
129153
*/}}
130154
{{- define "lms-data-service.itemsSchedulerJobName" -}}
131155
{{ include "lms-data-service.name" . }}-items-scheduler-job
132156
{{- end }}
133157

158+
{{/*
159+
Create the name of the JSON file used by the items-scheduler-job
160+
*/}}
161+
{{- define "lms-data-service.itemsSchedulerJobInputFile" -}}
162+
{{- if .Values.itemsSchedulerJob.jsonInputFile -}}
163+
{{ print .Values.itemsSchedulerJob.jsonInputFile }}
164+
{{- else if eq .Values.global.lmsType "WORKDAY" -}}
165+
{{ print "./temp/start-items-web-job.json" }}
166+
{{- else -}}
167+
{{ print "./temp/start-items-job.json" }}
168+
{{- end }}
169+
{{- end }}
170+
134171
{{/*
135172
Create the name of the CronJob items-inactive-scheduler-job
136173
*/}}
137174
{{- define "lms-data-service.itemsInactiveSchedulerJobName" -}}
138175
{{ include "lms-data-service.name" . }}-items-inactive-scheduler-job
139176
{{- end }}
140177

178+
{{/*
179+
Create the name of the JSON file used by the items-inactive-scheduler-job
180+
*/}}
181+
{{- define "lms-data-service.itemsInactiveSchedulerJobInputFile" -}}
182+
{{- if .Values.itemsInactiveSchedulerJob.jsonInputFile -}}
183+
{{ print .Values.itemsInactiveSchedulerJob.jsonInputFile }}
184+
{{- else if eq .Values.global.lmsType "WORKDAY" -}}
185+
{{ print "./temp/start-items-inactive-web-job.json" }}
186+
{{- else -}}
187+
{{ print "./temp/start-items-inactive-job.json" }}
188+
{{- end }}
189+
{{- end }}
190+
141191
{{/*
142192
Create the name of the CronJob learners-scheduler-job
143193
*/}}
144194
{{- define "lms-data-service.learnersSchedulerJobName" -}}
145195
{{ include "lms-data-service.name" . }}-learners-scheduler-job
146196
{{- end }}
197+
198+
{{/*
199+
Create the name of the JSON file used by the learners-scheduler-job
200+
*/}}
201+
{{- define "lms-data-service.learnersSchedulerJobInputFile" -}}
202+
{{- if .Values.learnersSchedulerJob.jsonInputFile -}}
203+
{{ print .Values.learnersSchedulerJob.jsonInputFile }}
204+
{{- else if eq .Values.global.lmsType "WORKDAY" -}}
205+
{{ print "./temp/start-learners-web-job.json" }}
206+
{{- else -}}
207+
{{ print "./temp/start-learners-job.json" }}
208+
{{- end }}
209+
{{- end }}
210+
211+
{{/*
212+
Create the name of the JSON file used by the learning-history-upload-job
213+
*/}}
214+
{{- define "lms-data-service.learningHistoryUploadJobInputFile" -}}
215+
{{- if .Values.learningHistoryUploadJob.jsonInputFile -}}
216+
{{ print .Values.learningHistoryUploadJob.jsonInputFile }}
217+
{{- else -}}
218+
{{ print "./temp/start-lms-learning-history-job.json" }}
219+
{{- end }}
220+
{{- end }}

charts/thub/charts/lms-data-service/templates/assigned-items-scheduler-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
- name: thub-event-scheduler-job
3232
image: "{{ .Values.assignedItemsSchedulerJob.image.repository }}:{{ .Values.assignedItemsSchedulerJob.image.tag | default (include "thub.eventSchedulerJobTag" .) }}"
3333
imagePullPolicy: {{ .Values.assignedItemsSchedulerJob.image.pullPolicy }}
34-
command: ["java", "-jar", "/home/app/application.jar", "jms", "./temp/start-assigned-items-job.json"]
34+
command: ["java", "-jar", "/home/app/application.jar", "jms", "{{ include "lms-data-service.assignedItemsSchedulerJobInputFile" . }}"]
3535
ports:
3636
- containerPort: {{ .Values.assignedItemsSchedulerJob.port }}
3737
name: http-server

charts/thub/charts/lms-data-service/templates/event-scheduler-job-input-files-configmap.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,31 @@ data:
4949
"instruction": "START",
5050
"communicationType": "SFTP"
5151
}
52+
# These jobs are used when integrating with Workday LMS
53+
start-instructors-web-job.json: |
54+
{
55+
"type": "INSTRUCTORS",
56+
"instruction": "START",
57+
"communicationType": "WEBSERVICE"
58+
}
59+
start-items-web-job.json: |
60+
{
61+
"type": "ITEMS",
62+
"instruction": "START",
63+
"communicationType": "WEBSERVICE"
64+
}
65+
start-items-inactive-web-job.json: |
66+
{
67+
"type": "ITEMS_INACTIVE",
68+
"instruction": "START",
69+
"communicationType": "WEBSERVICE"
70+
}
71+
start-learners-web-job.json: |
72+
{
73+
"type": "LEARNERS",
74+
"instruction": "START",
75+
"communicationType": "WEBSERVICE"
76+
}
5277
5378
{{/*
5479
Could use this code if we want to load them from files rather than have them here.

charts/thub/charts/lms-data-service/templates/instructors-scheduler-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
- name: thub-event-scheduler-job
3232
image: "{{ .Values.instructorsSchedulerJob.image.repository }}:{{ .Values.instructorsSchedulerJob.image.tag | default (include "thub.eventSchedulerJobTag" .) }}"
3333
imagePullPolicy: {{ .Values.instructorsSchedulerJob.image.pullPolicy }}
34-
command: ["java", "-jar", "/home/app/application.jar", "jms", "./temp/start-instructors-job.json"]
34+
command: ["java", "-jar", "/home/app/application.jar", "jms", "{{ include "lms-data-service.instructorsSchedulerJobInputFile" . }}"]
3535
ports:
3636
- containerPort: {{ .Values.instructorsSchedulerJob.port }}
3737
name: http-server

charts/thub/charts/lms-data-service/templates/items-inactive-scheduler-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
- name: thub-event-scheduler-job
3232
image: "{{ .Values.itemsInactiveSchedulerJob.image.repository }}:{{ .Values.itemsInactiveSchedulerJob.image.tag | default (include "thub.eventSchedulerJobTag" .) }}"
3333
imagePullPolicy: {{ .Values.itemsInactiveSchedulerJob.image.pullPolicy }}
34-
command: ["java", "-jar", "/home/app/application.jar", "jms", "./temp/start-items-inactive-job.json"]
34+
command: ["java", "-jar", "/home/app/application.jar", "jms", "{{ include "lms-data-service.itemsInactiveSchedulerJobInputFile" . }}"]
3535
ports:
3636
- containerPort: {{ .Values.itemsInactiveSchedulerJob.port }}
3737
name: http-server

charts/thub/charts/lms-data-service/templates/items-scheduler-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
- name: thub-event-scheduler-job
3232
image: "{{ .Values.itemsSchedulerJob.image.repository }}:{{ .Values.itemsSchedulerJob.image.tag | default (include "thub.eventSchedulerJobTag" .) }}"
3333
imagePullPolicy: {{ .Values.itemsSchedulerJob.image.pullPolicy }}
34-
command: ["java", "-jar", "/home/app/application.jar", "jms", "./temp/start-items-job.json"]
34+
command: ["java", "-jar", "/home/app/application.jar", "jms", "{{ include "lms-data-service.itemsSchedulerJobInputFile" . }}"]
3535
ports:
3636
- containerPort: {{ .Values.itemsSchedulerJob.port }}
3737
name: http-server

charts/thub/charts/lms-data-service/templates/learners-scheduler-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
- name: thub-event-scheduler-job
3232
image: "{{ .Values.learnersSchedulerJob.image.repository }}:{{ .Values.learnersSchedulerJob.image.tag | default (include "thub.eventSchedulerJobTag" .) }}"
3333
imagePullPolicy: {{ .Values.learnersSchedulerJob.image.pullPolicy }}
34-
command: ["java", "-jar", "/home/app/application.jar", "jms", "./temp/start-learners-job.json"]
34+
command: ["java", "-jar", "/home/app/application.jar", "jms", "{{ include "lms-data-service.learnersSchedulerJobInputFile" . }}"]
3535
ports:
3636
- containerPort: {{ .Values.learnersSchedulerJob.port }}
3737
name: http-server

charts/thub/charts/lms-data-service/templates/learning-history-upload-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
- name: thub-event-scheduler-job
3232
image: "{{ .Values.learningHistoryUploadJob.image.repository }}:{{ .Values.learningHistoryUploadJob.image.tag | default (include "thub.eventSchedulerJobTag" .) }}"
3333
imagePullPolicy: {{ .Values.learningHistoryUploadJob.image.pullPolicy }}
34-
command: ["java", "-jar", "/home/app/application.jar", "jms", "./temp/start-lms-learning-history-job.json"]
34+
command: ["java", "-jar", "/home/app/application.jar", "jms", "{{ include "lms-data-service.learningHistoryUploadJobInputFile" . }}"]
3535
ports:
3636
- containerPort: {{ .Values.learningHistoryUploadJob.port }}
3737
name: http-server

0 commit comments

Comments
 (0)