Skip to content

Commit

Permalink
Add a button to Workflow Dispatch to reset Dev
Browse files Browse the repository at this point in the history
* Bump Bitnami Postgres `14.3.1` -> `15.2.5`
* Bump Bitnami Redis `19.1.0` -> `19.1.3`
  • Loading branch information
rblaine95 committed Apr 24, 2024
1 parent 7610f7b commit 6ee5a67
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 4 deletions.
64 changes: 63 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: CICD

on:
workflow_dispatch:
inputs:
reset-deployments:
description: "Reset deployment: Clean start"
required: false
default: false
type: boolean
push:
branches:
- master
Expand Down Expand Up @@ -340,6 +346,7 @@ jobs:
cancel-in-progress: false
environment:
name: ${{
github.event.inputs.reset-deployments == 'true' && 'dev' ||
github.event_name == 'release' && 'prod' ||
(github.event_name == 'push' && github.event.repository.default_branch == github.ref_name) && 'stage' ||
'dev'
Expand Down Expand Up @@ -394,6 +401,60 @@ jobs:
with:
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
version: ${{ env.TAILSCALE_VERSION }}
- name: Helmfile Destroy
if: github.event.inputs.reset-deployments == 'true'
uses: helmfile/helmfile-action@v1.9.0
with:
helmfile-args: |
destroy \
--environment dev
helm-plugins: |
https://github.com/databus23/helm-diff,
https://github.com/jkroepke/helm-secrets
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
- name: Delete Pods and PVCs
if: github.event.inputs.reset-deployments == 'true'
run: kubectl delete pods,pvc --all --namespace yoma-v3-dev
- name: Deploy fresh Keycloak Postgres
if: github.event.inputs.reset-deployments == 'true'
uses: helmfile/helmfile-action@v1.9.0
with:
helmfile-args: |
apply \
--environment dev \
--selector=app=postgresql-keycloak
helm-plugins: |
https://github.com/databus23/helm-diff,
https://github.com/jkroepke/helm-secrets
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
- name: Deploy fresh Yoma Postgres
if: github.event.inputs.reset-deployments == 'true'
uses: helmfile/helmfile-action@v1.9.0
with:
helmfile-args: |
apply \
--environment dev \
--selector=app=postgresql
helm-plugins: |
https://github.com/databus23/helm-diff,
https://github.com/jkroepke/helm-secrets
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
- name: Deploy fresh Redis
if: github.event.inputs.reset-deployments == 'true'
uses: helmfile/helmfile-action@v1.9.0
with:
helmfile-args: |
apply \
--environment dev \
--selector=app=redis
helm-plugins: |
https://github.com/databus23/helm-diff,
https://github.com/jkroepke/helm-secrets
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
# Diff on PR draft, otherwise Apply
- name: Helmfile Apply/Diff Keycloak
if: (
Expand Down Expand Up @@ -428,7 +489,8 @@ jobs:
${{ (github.event_name == 'pull_request' && github.event.pull_request.draft) && 'diff' || 'apply' }} \
--environment ${{ vars.ENVIRONMENT }} \
--selector app=yoma-api \
--set postInstallHook.ref=${{ github.event_name == 'release' && github.ref_name || github.sha }}
${{ github.event.inputs.reset-deployments == 'true' && '--set replicaCount=1 \' || '\' }}
--set postInstallHook.ref=${{ github.event_name == 'release' && github.ref_name || github.sha }} \
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
helm-plugins: |
Expand Down
7 changes: 4 additions & 3 deletions helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ releases:
namespace: {{ .Values.namespace }}
# https://github.com/bitnami/charts/tree/main/bitnami/postgresql
chart: oci://registry-1.docker.io/bitnamicharts/postgresql
version: "14.3.1"
version: "15.2.5"
installed: {{ .Values.postgresEnabled }}
set:
- name: fullnameOverride
Expand All @@ -90,7 +90,7 @@ releases:
namespace: {{ .Values.namespace }}
# https://github.com/bitnami/charts/tree/main/bitnami/postgresql
chart: oci://registry-1.docker.io/bitnamicharts/postgresql
version: "14.3.1"
version: "15.2.5"
installed: {{ .Values.postgresEnabled }}
set:
- name: fullnameOverride
Expand All @@ -110,8 +110,9 @@ releases:
labels:
app: redis
namespace: {{ .Values.namespace }}
# https://github.com/bitnami/charts/tree/main/bitnami/redis
chart: oci://registry-1.docker.io/bitnamicharts/redis
version: "19.1.0"
version: "19.1.3"
installed: {{ .Values.redisEnabled }}
values:
- fullnameOverride: redis
Expand Down

0 comments on commit 6ee5a67

Please sign in to comment.