Skip to content

Commit

Permalink
fix(DMVP-3604): have chart fixes related volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdntgrn committed Jun 14, 2024
1 parent 05f6eb4 commit 8d8eadb
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 12 deletions.
39 changes: 27 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,36 @@ name: Release helm chart
on:
push:
branches:
- main
- DMVP-3604-helm-charts-improvements

jobs:
release:
semantic-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
with:
fetch-depth: 0
- name: Configure Git
filters: |
charts_changed:
- 'charts/*'
# run only if some 'charts' files were changed
- name: backend tests
if: steps.filter.outputs.backend == 'true'
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Run Release
uses: helm/[email protected]
env:
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
echo "charts changed: ${{ steps.filter.outputs.charts_changed_files }}"
# release:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Configure Git
# run: |
# git config user.name "$GITHUB_ACTOR"
# git config user.email "[email protected]"
# - name: Run Release
# uses: helm/[email protected]
# env:
# CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
9 changes: 9 additions & 0 deletions charts/base-cronjob/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ spec:
configmap: "{{ $job.config | toYaml | sha256sum | trunc 8 }}"
spec:
serviceAccountName: {{ $job.serviceAccount.name }}
{{- with $job.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 12 }}
{{- end }}
restartPolicy: {{ $job.restartPolicy }}
containers:
- name: {{ $job.name | quote }}
Expand Down Expand Up @@ -66,6 +70,9 @@ spec:
envFrom:
- configMapRef:
name: {{ $job.name | quote}}
{{- with $job.envFrom }}
{{- toYaml . | nindent 16 }}
{{- end }}
volumeMounts:
{{- range $index, $element := $job.volumes }}
- name: {{ coalesce $element.name (add $index 1) }}
Expand Down Expand Up @@ -94,11 +101,13 @@ spec:
claimName: {{ $element.persistentVolumeClaim.claimName }}
{{- end }}
{{- end }}
{{- if $element.configMap }}
configMap:
name: {{ $element.configMap.name | default $job.name}}
{{- if $element.configMap.defaultMode }}
defaultMode: {{ $element.configMap.defaultMode }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/base/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ spec:
{{- if eq $element.container "extra"}}
- name: {{ coalesce $element.name (add $index 1) }}
mountPath: {{ $element.mountPath }}
{{- if $element.subPath }}
subPath: {{ $element.subPath }}
{{- end }}
readOnly: {{ $element.readOnly | default false }}
{{- end }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/base/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ spec:
targetPort: {{ .Values.service.targetPort | default .Values.containerPort }}
protocol: {{ .Values.service.protocol }}
name: {{ .Values.service.name }}
{{- if .Values.service.extraPorts }}
{{- toYaml .Values.service.extraPorts | nindent 4 }}
{{- end }}
selector:
{{- include "base.selectorLabels" . | nindent 4 }}
{{- end }}

0 comments on commit 8d8eadb

Please sign in to comment.