Skip to content

Commit

Permalink
feat: Add dependey update before deploy/linting
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik003 authored and MoritzWeber0 committed Jan 6, 2023
1 parent 8e520b1 commit 15cdba5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: lint

on:
push:
branches: ['**']
branches: ["**"]
tags: ["v*.*.*"]
pull_request:
branches: [master, staging]
Expand All @@ -24,11 +24,14 @@ jobs:
run: |
go install github.com/yannh/kubeconform/cmd/kubeconform@latest
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Run helm dependency update
run: |
helm dependency update ./helm
- name: Run helm lint
run: |
helm lint --strict ./helm
- name: Validate chart with kubernetes schema
run : |
run: |
helm template ./helm | kubeconform -strict
pre-commit:
runs-on: ubuntu-latest
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: push

on:
push:
branches: ['**']
branches: ["**"]
tags: ["v*.*.*"]
pull_request:
branches: [master, staging]
Expand Down Expand Up @@ -98,6 +98,9 @@ jobs:
run: |
kubectl patch serviceaccount default \
-p '{"imagePullSecrets": [{"name": "github"}]}'
- name: Update dependencies
run: |
helm dependency update ./helm
- name: Install chart
run: |
export TAG=${{ steps.tag.outputs.branch }}
Expand All @@ -112,10 +115,19 @@ jobs:
--set general.port=8080 \
--set backend.authentication.oauth.endpoints.wellKnown="http://test-oauth-mock:8080/default/.well-known/openid-configuration" \
./helm
- name: Scale down backend deployment
run: |
kubectl scale deployment test-backend --replicas=0
- name: Wait for backend pods to be deleted
run: |
kubectl wait pod --selector="id=test-deployment-backend" --for=delete --timeout=2m
- name: Add secret to backend serviceaccount
run: |
kubectl patch deployment/test-backend \
-p '{"spec": {"template": {"spec": {"imagePullSecrets": [{"name": "github"}]}}}}'
- name: Scale up backend deployment
run: |
kubectl scale deployment test-backend --replicas=1
- name: Wait for all containers to be ready
run: |
kubectl wait --all deployment --for condition=Available=True --timeout=5m
Expand All @@ -131,7 +143,11 @@ jobs:
if: always()
run: |
kubectl describe pods
- name: Describe nodes
if: always()
run: |
kubectl describe nodes
- name: Print logs of backend container
if: always()
run: |
kubectl logs deployment/test-backend
kubectl logs deployment/test-backend test-backend
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ helm-deploy:
@k3d cluster list $(CLUSTER_NAME) >/dev/null || $(MAKE) create-cluster
@kubectl create namespace t4c-sessions 2> /dev/null || true
@helm upgrade --install \
--dependency-update \
--kube-context k3d-$(CLUSTER_NAME) \
--create-namespace \
--namespace $(NAMESPACE) \
Expand Down Expand Up @@ -91,7 +92,7 @@ open:

clear-backend-db:
kubectl delete deployment -n t4c-manager $(RELEASE)-backend-postgres
kubectl delete pvc -n t4c-manager $(RELEASE)-volume-backend-postgres
kubectl delete pvc -n t4c-manager $(RELEASE)-backend-postgres
$(MAKE) helm-deploy

rollout:
Expand Down

0 comments on commit 15cdba5

Please sign in to comment.