Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infra/fix cicd #745

Merged
merged 5 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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