Skip to content

Commit

Permalink
Infra/fix cicd (#745)
Browse files Browse the repository at this point in the history
* use valid label characters

* use valid label characters

* just check if helm chart is installed

* fix if statement
  • Loading branch information
maxmwang authored Nov 20, 2024
1 parent b0f50bb commit 2429378
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,22 @@ jobs:
script: |
set -e # Exit immediately if a command fails
# Check if helm chart exists
helm status ${{ inputs.name }} &>/dev/null && status=true || status=false
# Upgrade helm chart, or install if not exists
helm upgrade ${{ inputs.name }} oci://registry-1.docker.io/octoberkeleytime/bt-app \
--install \
--version=${{ inputs.version }} \
--namespace=bt \
--values <(echo "${{ inputs.values }}")
# Restart deployment if helm chart existed
if [ $status = true ]; then
kubectl rollout restart deployment ${{ inputs.name }}-backend
kubectl rollout restart deployment ${{ inputs.name }}-frontend
fi
# Check container status
kubectl rollout status --timeout=180s deployment ${{ inputs.name }}-backend
kubectl rollout status --timeout=180s deployment ${{ inputs.name }}-frontend
5 changes: 0 additions & 5 deletions infra/app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ 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 }}
{{/*
the timestamp label forces a rolling update when the value is changed. necessary since
we do not change the chart or image version when deploying.
*/}}
timestamp: {{ date "2006-01-02_15.04.05Z" (now) | quote }}
env: {{ .Values.env }}
{{- end -}}

Expand Down

0 comments on commit 2429378

Please sign in to comment.