From 841f762447b2013cef10a080c0ae160586db6aa5 Mon Sep 17 00:00:00 2001 From: maxi418 <144135803+maxi418@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:52:15 +0100 Subject: [PATCH] DBP-1084-rollout-to-namespaces-do-not-delete-dbs (#11) * test new pipeline * add describing comment * renamed variables * update versions and variable names * changed workflow version * changed version for test * remove typo * reusable workflow to convert branch name * use new workflow versions --- ...publish-check-deploy-on-push-scheduled.yml | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/image-and-helm-publish-check-deploy-on-push-scheduled.yml b/.github/workflows/image-and-helm-publish-check-deploy-on-push-scheduled.yml index 3674c2c..002dcf1 100644 --- a/.github/workflows/image-and-helm-publish-check-deploy-on-push-scheduled.yml +++ b/.github/workflows/image-and-helm-publish-check-deploy-on-push-scheduled.yml @@ -24,30 +24,33 @@ jobs: if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }} runs-on: ubuntu-latest outputs: - SELECT_HELM_VERION_GENERATION: ${{ steps.select_generation.outputs.SELECT_HELM_VERION_GENERATION }} + SELECT_HELM_VERSION_GENERATION: ${{ steps.select_generation.outputs.SELECT_HELM_VERSION_GENERATION }} SELECT_IMAGE_TAG_GENERATION: ${{ steps.select_generation.outputs.SELECT_IMAGE_TAG_GENERATION }} steps: - id: select_generation shell: bash run: | if ${{ github.ref_name == 'main' }}; then - echo "SELECT_HELM_VERION_GENERATION=timestamp" >> "$GITHUB_OUTPUT" + echo "SELECT_HELM_VERSION_GENERATION=timestamp" >> "$GITHUB_OUTPUT" echo "SELECT_IMAGE_TAG_GENERATION=commit_hash" >> "$GITHUB_OUTPUT" else - echo "SELECT_HELM_VERION_GENERATION=ticket_from_branch_timestamp" >> "$GITHUB_OUTPUT" - echo "SELECT_IMAGE_TAG_GENERATION=ticket_from_branch" >> "$GITHUB_OUTPUT" + echo "SELECT_HELM_VERSION_GENERATION=specified" >> "$GITHUB_OUTPUT" + echo "SELECT_IMAGE_TAG_GENERATION=specified" >> "$GITHUB_OUTPUT" fi release_helm: if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }} - needs: + needs: + - create_branch_identifier - select_helm_version_generation_and_image_tag_generation uses: dBildungsplattform/dbp-github-workflows/.github/workflows/chart-release.yaml@7 secrets: inherit with: chart_name: dbildungs-iam-ldap - helm_chart_version_generation: ${{ needs. select_helm_version_generation_and_image_tag_generation.outputs.SELECT_HELM_VERION_GENERATION }} - image_tag_generation: ${{ needs. select_helm_version_generation_and_image_tag_generation.outputs.SELECT_IMAGE_TAG_GENERATION }} + helm_chart_version_generation: ${{ needs. select_helm_version_generation_and_image_tag_generation.outputs.SELECT_HELM_VERSION_GENERATION }} + helm_chart_version: ${{ github.ref_name == 'main' && '' || needs.create_branch_identifier.outputs.chart_version_from_branch }} + image_tag_generation: ${{ needs. select_helm_version_generation_and_image_tag_generation.outputs.SELECT_IMAGE_TAG_GENERATION }} + image_tag: ${{ github.ref_name == 'main' && '' || needs.create_branch_identifier.outputs.image_tag_from_branch }} wait_for_helm_chart_to_get_published: needs: @@ -60,13 +63,13 @@ jobs: branch_meta: if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }} - uses: dBildungsplattform/spsh-app-deploy/.github/workflows/get-branch-meta.yml@3 + uses: dBildungsplattform/spsh-app-deploy/.github/workflows/get-branch-meta.yml@6 create_branch_identifier: if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }} needs: - branch_meta - uses: dBildungsplattform/spsh-app-deploy/.github/workflows/deploy-branch-to-namespace.yml@3 + uses: dBildungsplattform/spsh-app-deploy/.github/workflows/convert-branch-name.yml@6 with: branch: ${{ needs.branch_meta.outputs.branch }} @@ -76,19 +79,21 @@ jobs: - branch_meta - create_branch_identifier - wait_for_helm_chart_to_get_published - uses: dBildungsplattform/spsh-app-deploy/.github/workflows/deploy.yml@5 + uses: dBildungsplattform/spsh-app-deploy/.github/workflows/deploy.yml@6 with: dbildungs_iam_server_branch: ${{ needs.branch_meta.outputs.ticket }} schulportal_client_branch: ${{ needs.branch_meta.outputs.ticket }} dbildungs_iam_keycloak_branch: ${{ needs.branch_meta.outputs.ticket }} dbildungs_iam_ldap_branch: ${{ needs.branch_meta.outputs.ticket }} namespace: ${{ needs.create_branch_identifier.outputs.namespace_from_branch }} + database_recreation: ${{ github.ref_name == 'main' && 'true' || 'false' }} + # database_recreation: "true" # to force database recreation this has be set to true secrets: inherit # On Delete create_branch_identifier_for_deletion: if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch' }} - uses: dBildungsplattform/spsh-app-deploy/.github/workflows/deploy-branch-to-namespace.yml@3 + uses: dBildungsplattform/spsh-app-deploy/.github/workflows/convert-branch-name.yml@6 with: branch: ${{ github.event.ref }}