Skip to content

Commit

Permalink
Merge pull request #1415 from porter-dev/stefanmcshane-patch-1
Browse files Browse the repository at this point in the history
Add PORTER_IMAGE_TAG to jobs
  • Loading branch information
stefanmcshane authored Oct 2, 2024
2 parents e67d1c8 + 7c970fa commit ebecc34
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/pr_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@ jobs:
- name: Helm template - worker
if: steps.changed-files.outputs.any_changed == 'true'
shell: bash
run: helm template applications/worker -f applications/testdata/worker.yaml
run: helm template applications/worker -f applications/testdata/worker.yaml

- name: Helm template - job
if: steps.changed-files.outputs.any_changed == 'true'
shell: bash
run: helm template applications/job -f applications/testdata/job.yaml
10 changes: 9 additions & 1 deletion applications/job/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ spec:
{{ end }}
{{ end }}
env:
{{- if .Values.global }}
{{- if .Values.global.image }}
{{- if .Values.global.image.tag }}
- name: PORTER_IMAGE_TAG
value: "{{ .Values.global.image.tag }}"
{{- end }}
{{- end }}
{{- end }}
{{- range $key, $val := .Values.container.env.normal }}
- name: {{ $key }}
{{- $splVal := split "_" $val -}}
Expand Down Expand Up @@ -258,4 +266,4 @@ spec:
{{- if (.Values.sidecar.timeout) }}
activeDeadlineSeconds: {{ .Values.sidecar.timeout }}
{{- end }}
{{ end }}
{{ end }}
57 changes: 57 additions & 0 deletions applications/testdata/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
cloudsql:
connectionName: ""
dbPort: 0
enabled: false
serviceAccountJSONSecret: ""
configMapRefs:
- dev.2
- 5300-db00d8.10
container:
command: python runjob.py
env:
normal: null
port: 3000
deploymentStrategy:
blueGreen: {}
fileSecretMounts:
enabled: false
mounts: null
fullnameOverride: job-dev
labels:
porter.run/absolute-name: job-dev
porter.run/app-id: "5300"
porter.run/app-instance-id: 2e9b5ad3-d53c-4bf7-9945-7dc59336f44e
porter.run/app-name: porter-app
porter.run/app-revision-id: 3db36407-cdff-4cf7-9cd2-c91ea5b6fcdd
porter.run/deployment-target-id: db00d884-f248-493d-9263-9286d7cbde37
porter.run/porter-application: "true"
porter.run/service-name: job-dev
porter.run/service-type: job
nodeGroups: null
paused: true
podAnnotations: {}
podLabels:
porter.run/absolute-name: job-dev
porter.run/app-name: alert-pipeline-dev
porter.run/porter-application: "true"
porter.run/service-name: classifier-dev
porter.run/service-type: job
replicaCount: 1
resources:
limits: {}
requests:
cpu: "2.5"
memory: 10430M
schedule:
enabled: false
value: 1 2 3 4 5
secretRefs:
- dev.2
- 5300-db00d8.10
sidecar:
timeout: 86400
terminationGracePeriodSeconds: 30
global:
image:
tag: "1234adfa"
repository: "porterdev/hello-porter"

0 comments on commit ebecc34

Please sign in to comment.