-
Notifications
You must be signed in to change notification settings - Fork 0
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
DBP-1084-rollout-to-namespaces-do-not-delete-dbs #47
Open
aimee-889
wants to merge
13
commits into
main
Choose a base branch
from
DBP-1084-rollout-to-namespaces-do-not-delete-dbs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8bf78f1
init command
aimee-889 cd5ceb2
fix names and actions reference
aimee-889 4b26e1c
add missing slash
aimee-889 ef4eb21
fix expression
aimee-889 e59675c
improve naming
aimee-889 b344920
add sleep
aimee-889 9d04000
atually use the value false
aimee-889 44f6f77
tune message
aimee-889 60c4516
set deletion per default to false
aimee-889 ff51af0
check if this works
aimee-889 ec0ddb8
test new Pipeline
aimee-889 e0194f6
change name
aimee-889 c4045dc
merge main
aimee-889 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,11 @@ on: | |
description: "Enable Seeding (true, false, chart_value)" | ||
default: chart_value | ||
type: string | ||
database_deletion: | ||
required: false | ||
description: "Decide whether Databases should be deleted or not" | ||
default: true | ||
aimee-889 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
type: string | ||
secrets: | ||
SPSH_DEV_KUBECONFIG: | ||
required: true | ||
|
@@ -82,7 +87,7 @@ jobs: | |
with: | ||
branch: ${{ github.ref_name == 'main' && inputs.namespace || needs.create_ingress_prefix.outputs.ticket }} | ||
|
||
create_dbildungs_iam_keycloak_db_name: | ||
recreate_dbildungs_iam_keycloak_db_name: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
db_name: ${{ steps.create_db_name.outputs.db_name }} | ||
|
@@ -96,7 +101,7 @@ jobs: | |
echo "before" ${{ inputs.namespace }} "after" $temp | ||
echo "db_name=$temp" >> $GITHUB_OUTPUT | ||
|
||
create_dbildungs_iam_server_db_name: | ||
recreate_dbildungs_iam_server_db_name: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
db_name: ${{ steps.create_db_name.outputs.db_name }} | ||
|
@@ -117,8 +122,8 @@ jobs: | |
- 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 | ||
- recreate_dbildungs_iam_keycloak_db_name | ||
- recreate_dbildungs_iam_server_db_name | ||
runs-on: 'ubuntu-latest' | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
@@ -136,7 +141,7 @@ jobs: | |
with: | ||
repository: 'dBildungsplattform/spsh-app-deploy' | ||
# comment this in to test changes of a branch in repo | ||
# ref: "<branch_name>" | ||
ref: "DBP-1084-rollout-to-namespaces-do-not-delete-dbs" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change back to empty before merge |
||
|
||
- name: Set up kubectl and Helm | ||
uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f #v4.0.0 | ||
|
@@ -216,38 +221,39 @@ jobs: | |
run: | | ||
kubectl --namespace=${{ inputs.namespace }} apply -f ./dbildungs-iam-ldap-config-apply.yaml | ||
|
||
- name: Create Database for dbildungs-iam-keycloak | ||
- name: "Recreate Database for dbildungs-iam-keycloak - Deletion: ${{ inputs.database_deletion }}" | ||
run: | | ||
# Generate timestamp for job name uniqueness | ||
DATE=$(date +%Y%m%d%H%M%S) | ||
|
||
# Define job name for Keycloak database creation job | ||
HELM_KEYCLOAK_DB_JOB_NAME="psql-db-${DATE}-keycloak-${{ needs.create_lowercase_ingress_prefix.outputs.namespace_from_branch }}" | ||
|
||
# Deploy Database for dbildungs-iam-keycloak | ||
# Recreate Database for dbildungs-iam-keycloak | ||
helm upgrade --install \ | ||
$HELM_KEYCLOAK_DB_JOB_NAME \ | ||
./charts/postgres_config \ | ||
./charts/postgres_recreate_databases \ | ||
--namespace ${{ inputs.namespace }} \ | ||
--set auth.existingSecret="psql-config-secret" \ | ||
--set database.name=${{ needs.create_dbildungs_iam_keycloak_db_name.outputs.db_name }} | ||
|
||
--set database.name=${{ needs.recreate_dbildungs_iam_keycloak_db_name.outputs.db_name }} \ | ||
--set database.deletion=${{ inputs.database_deletion }} | ||
|
||
- name: Create Database for dbildungs-iam-server | ||
- name: "Recreate Database for dbildungs-iam-server - Deletion: ${{ inputs.database_deletion }}" | ||
run: | | ||
# Generate timestamp for job name uniqueness | ||
DATE=$(date +%Y%m%d%H%M%S) | ||
|
||
# Define job name for SPSH-App database creation job | ||
HELM_SERVER_DB_JOB_NAME="psql-db-${DATE}-database-${{ needs.create_lowercase_ingress_prefix.outputs.namespace_from_branch }}" | ||
|
||
# Deploy Database for SPSH-App | ||
# Recreate Database for SPSH-App | ||
helm upgrade --install \ | ||
$HELM_SERVER_DB_JOB_NAME \ | ||
./charts/postgres_config \ | ||
./charts/postgres_recreate_databases \ | ||
--namespace ${{ inputs.namespace }} \ | ||
--set auth.existingSecret="psql-config-secret" \ | ||
--set database.name=${{ needs.create_dbildungs_iam_server_db_name.outputs.db_name }} | ||
--set database.name=${{ needs.recreate_dbildungs_iam_server_db_name.outputs.db_name }} \ | ||
--set database.deletion=${{ inputs.database_deletion }} | ||
|
||
# Wait is needed, dbildungs_iam_server expects keycloak to be up! | ||
- name: Deploy dbildungs_iam_keycloak Helm chart | ||
|
@@ -259,7 +265,7 @@ jobs: | |
--set auth.existingSecret="dbildungs-iam-keycloak" \ | ||
--set keycloakHostname=${{ needs.create_lowercase_ingress_prefix.outputs.namespace_from_branch }}-keycloak.dev.spsh.dbildungsplattform.de \ | ||
--set frontendHostname=${{ needs.create_lowercase_ingress_prefix.outputs.namespace_from_branch }}.dev.spsh.dbildungsplattform.de \ | ||
--set database.name=${{ needs.create_dbildungs_iam_keycloak_db_name.outputs.db_name }} \ | ||
--set database.name=${{ needs.recreate_dbildungs_iam_keycloak_db_name.outputs.db_name }} \ | ||
--set database.username=spshdeveloper \ | ||
--wait \ | ||
--timeout 210s | ||
|
@@ -295,7 +301,7 @@ jobs: | |
--set auth.existingSecret="dbildungs-iam-server" \ | ||
--set backendHostname=${{ needs.create_lowercase_ingress_prefix.outputs.namespace_from_branch }}.dev.spsh.dbildungsplattform.de \ | ||
--set keycloakHostname=${{ needs.create_lowercase_ingress_prefix.outputs.namespace_from_branch }}-keycloak.dev.spsh.dbildungsplattform.de \ | ||
--set database.name=${{ needs.create_dbildungs_iam_server_db_name.outputs.db_name }} \ | ||
--set database.name=${{ needs.recreate_dbildungs_iam_server_db_name.outputs.db_name }} \ | ||
${{ inputs.dbseeding != 'chart_value' && format('--set backend.dbseeding.enabled={0}', inputs.dbseeding) || '' }} \ | ||
--wait \ | ||
--timeout 360s | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change back to @5 or @6 before merge