Skip to content

Commit

Permalink
force update by adding timestamp label
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmwang committed Nov 20, 2024
1 parent e6cdb77 commit 40bba46
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,5 @@ jobs:
run: |
cd ./infra
helm registry login registry-1.docker.io -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
helm dependency update ${{ matrix.chart }}
helm package ${{ matrix.chart }} --version ${{ inputs.chart_ver }}
helm package ${{ matrix.chart }} --version ${{ inputs.chart_ver }} --dependency-update
helm push bt-${{ matrix.chart }}-${{ inputs.chart_ver }}.tgz oci://registry-1.docker.io/${{ secrets.DOCKER_USERNAME }}
12 changes: 12 additions & 0 deletions infra/app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ Labels applied to all resources.
helm.sh/chart: {{ include "bt-app.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}

{{/*
forces a rolling update when the value is changed. necessary since
we do not change the chart or image version when deploying.
*/}}
timestamp: {{ now | quote }}

env: {{ .Values.env }}
{{- end -}}

Expand All @@ -30,6 +37,11 @@ app.kubernetes.io/name: updater
{{ include "bt-app.labels" . }}
{{- end -}}

{{- define "bt-app.cleanupLabels" -}}
app.kubernetes.io/name: cleanup
{{ include "bt-app.labels" . }}
{{- end -}}

{{- define "bt-app.backendName" -}}
{{ .Release.Name }}-backend
{{- end -}}
Expand Down
2 changes: 2 additions & 0 deletions infra/app/templates/cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "bt-app.cleanupName" . }}
labels:
{{- include "bt-app.cleanupLabels" . | nindent 4 }}
spec:
template:
spec:
Expand Down

0 comments on commit 40bba46

Please sign in to comment.