Skip to content

Commit

Permalink
DBP-799-openldap-image-helm-chart-add-rollout (#36)
Browse files Browse the repository at this point in the history
DBP-799-openldap-image-helm-chart-add-rollout (#36)
  • Loading branch information
aimee-889 authored Jul 8, 2024
1 parent ed1ffd0 commit 7908232
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-dev-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
needs:
- check_namespace_input
- create_branch_identifier
uses: dBildungsplattform/spsh-app-deploy/.github/workflows/deploy.yml@4
uses: dBildungsplattform/spsh-app-deploy/.github/workflows/deploy.yml@5
with:
dbildungs_iam_server_branch: ${{ github.event.inputs.dbildungs_iam_server_branch }}
schulportal_client_branch: ${{ github.event.inputs.dbildungs_iam_client_branch }}
Expand Down
44 changes: 42 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ on:
description: "Has to be main or in format <project>-<ticketnumber>, e.g. spsh-130"
default: main
type: string
dbildungs_iam_ldap_branch:
required: true
description: "Has to be main or in format <project>-<ticketnumber>, e.g. spsh-130"
default: main
type: string
dbseeding:
required: false
description: "Enable Seeding (true, false, chart_value)"
Expand Down Expand Up @@ -60,6 +65,13 @@ jobs:
branch: ${{ inputs.dbildungs_iam_keycloak_branch }}
chart_name: "dbildungs-iam-keycloak"

find_dbildungs_iam_ldap_helm_chart_tag:
uses: dBildungsplattform/spsh-app-deploy/.github/workflows/find-helm-chart-by-ticket-or-main-in-registry.yml@2
with:
github_repository: "dBildungsplattform/helm-charts-registry"
branch: ${{ inputs.dbildungs_iam_ldap_branch }}
chart_name: "dbildungs-iam-ldap"

create_ingress_prefix:
uses: dBildungsplattform/spsh-app-deploy/.github/workflows/get-branch-meta.yml@2

Expand Down Expand Up @@ -103,6 +115,7 @@ jobs:
- find_dbildungs_iam_server_helm_chart_tag
- find_schulportal_client_helm_chart_tag
- find_dbildungs_iam_keycloak_helm_chart_tag
- find_dbildungs_iam_ldap_helm_chart_tag
- create_lowercase_ingress_prefix
- create_dbildungs_iam_keycloak_db_name
- create_dbildungs_iam_server_db_name
Expand Down Expand Up @@ -153,6 +166,11 @@ jobs:
wget https://github.com/dBildungsplattform/helm-charts-registry/releases/download/${{ needs.find_dbildungs_iam_keycloak_helm_chart_tag.outputs.helm_chart_tagname }}/${{ needs.find_dbildungs_iam_keycloak_helm_chart_tag.outputs.helm_chart_tagname }}.tgz
tar -zxvf ${{ needs.find_dbildungs_iam_keycloak_helm_chart_tag.outputs.helm_chart_tagname }}.tgz
- name: Download dbildungs_iam_ldap Helm chart
run: |
wget https://github.com/dBildungsplattform/helm-charts-registry/releases/download/${{ needs.find_dbildungs_iam_ldap_helm_chart_tag.outputs.helm_chart_tagname }}/${{ needs.find_dbildungs_iam_ldap_helm_chart_tag.outputs.helm_chart_tagname }}.tgz
tar -zxvf ${{ needs.find_dbildungs_iam_ldap_helm_chart_tag.outputs.helm_chart_tagname }}.tgz
# On branches the ticket number is used as image tag. To ensure the pods are restarted
# and pull the the latest image, we uninstall the helm release first. (Otherwise same tag -> no change)
# We also need to uninstall all pods to savely recreate the database
Expand Down Expand Up @@ -182,6 +200,18 @@ jobs:
run: |
kubectl --namespace=${{ inputs.namespace }} apply -f ./dbildungs-iam-keycloak-secret-dev.yaml
- name: Create dbildungs-iam-ldap secret
run: |
kubectl --namespace=${{ inputs.namespace }} apply -f ./dbildungs-iam-ldap-secret-dev.yaml
- name: Create dbildungs-iam-ldap modify secret
run: |
kubectl --namespace=${{ inputs.namespace }} apply -f ./dbildungs-iam-ldap-config-modify.yaml
- name: Create dbildungs-iam-ldap apply secret
run: |
kubectl --namespace=${{ inputs.namespace }} apply -f ./dbildungs-iam-ldap-config-apply.yaml
- name: Create Database for dbildungs-iam-keycloak
run: |
# Generate timestamp for job name uniqueness
Expand All @@ -198,6 +228,17 @@ jobs:
--set auth.existingSecret="psql-config-secret" \
--set database.name=${{ needs.create_dbildungs_iam_keycloak_db_name.outputs.keycloak_db_name }}
# even though the initTLSSecret.secret value is set it has no effect if the initTLSSecret in not enabled (default: false) - only necessary for External IP
- name: Deploy dbildungs_iam_ldap Helm chart
run: |
helm upgrade --install \
dbildungs-iam-ldap \
dbildungs-iam-ldap \
--namespace ${{ inputs.namespace }} \
--set global.existingSecret="dbildungs-iam-ldap" \
--set initTLSSecret.secret="dbildungs-iam-ldap-tls" \
--wait
- name: Create Database for dbildungs-iam-server
run: |
# Generate timestamp for job name uniqueness
Expand All @@ -213,7 +254,6 @@ jobs:
--namespace ${{ inputs.namespace }} \
--set auth.existingSecret="psql-config-secret" \
--set database.name=${{ needs.create_dbildungs_iam_server_db_name.outputs.server_db_name }}
# Wait is needed, dbildungs_iam_server expects keycloak to be up!
- name: Deploy dbildungs_iam_keycloak Helm chart
Expand All @@ -228,7 +268,7 @@ jobs:
--set database.name=${{ needs.create_dbildungs_iam_keycloak_db_name.outputs.keycloak_db_name }} \
--set database.username=spshdeveloper \
--wait
- name: Deploy schulportal_client Helm chart
run: |
helm upgrade --install \
Expand Down
6 changes: 6 additions & 0 deletions dbildungs-iam-ldap-config-apply.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: onepassword.com/v1
kind: OnePasswordItem
metadata:
name: dbildungs-iam-ldap-config-apply
spec:
itemPath: "vaults/spsh-dev-schulportal/items/dbildungs-iam-ldap-config-apply"
6 changes: 6 additions & 0 deletions dbildungs-iam-ldap-config-modify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: onepassword.com/v1
kind: OnePasswordItem
metadata:
name: dbildungs-iam-ldap-config-modify
spec:
itemPath: "vaults/spsh-dev-schulportal/items/dbildungs-iam-ldap-config-modify"
6 changes: 6 additions & 0 deletions dbildungs-iam-ldap-secret-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: onepassword.com/v1
kind: OnePasswordItem
metadata:
name: dbildungs-iam-ldap
spec:
itemPath: "vaults/spsh-dev-schulportal/items/dbildungs-iam-ldap"

0 comments on commit 7908232

Please sign in to comment.