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 f3c5365
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
37 changes: 37 additions & 0 deletions .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,36 @@ 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,
https://github.com/aslafy-z/helm-git
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 DBs
if: github.event.inputs.reset-deployments == 'true'
uses: helmfile/helmfile-action@v1.9.0
with:
helmfile-args: |
apply \
--environment dev \
--selector=app=postgresql-keycloak \
--selector=app=postgresql \
--selector=app=redis
helm-plugins: |
https://github.com/databus23/helm-diff,
https://github.com/jkroepke/helm-secrets,
https://github.com/aslafy-z/helm-git
# Diff on PR draft, otherwise Apply
- name: Helmfile Apply/Diff Keycloak
if: (
Expand Down
13 changes: 9 additions & 4 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 @@ -81,6 +81,8 @@ releases:
value: keycloak
- name: auth.database
value: keycloak
- name: primary.resourcesPreset
value: medium
secrets:
- ./helm/postgresql-keycloak/conf/{{ .Environment.Name }}/secrets.yaml

Expand All @@ -90,7 +92,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 @@ -99,6 +101,8 @@ releases:
value: yoma
- name: auth.database
value: yoma-dev
- name: primary.resourcesPreset
value: medium
# - name: primary.extendedConfiguration
# value: |
# log_statement = 'all'
Expand All @@ -110,8 +114,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 Expand Up @@ -176,7 +181,7 @@ releases:
- ./helm/yoma-web/conf/{{ .Environment.Name }}/secrets.yaml
---
helmDefaults:
timeout: 180
timeout: 300
wait: true
atomic: true
cleanupOnFail: true
Expand Down

0 comments on commit f3c5365

Please sign in to comment.