Skip to content

Commit

Permalink
test deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
aimee-889 committed Aug 23, 2024
1 parent d2a4cd6 commit 14f5671
Showing 1 changed file with 89 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,106 +14,106 @@ concurrency:
cancel-in-progress: true

jobs:
# scan_helm:
# # scan_helm:
# # if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }}
# # uses: dBildungsplattform/dbp-github-workflows/.github/workflows/check-helm-kics.yaml@5
# # permissions:
# # contents: read

# # select_helm_version_generation_and_image_tag_generation:
# # if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }}
# # needs:
# # - scan_helm
# # runs-on: ubuntu-latest
# # outputs:
# # SELECT_HELM_VERION_GENERATION: ${{ steps.select_generation.outputs.SELECT_HELM_VERION_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_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"
# # fi
# # release_helm:
# # if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }}
# # needs:
# # - select_helm_version_generation_and_image_tag_generation
# # uses: dBildungsplattform/dbp-github-workflows/.github/workflows/chart-release.yaml@5
# # 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 }}

# branch_meta:
# if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }}
# uses: dBildungsplattform/dbp-github-workflows/.github/workflows/check-helm-kics.yaml@5
# permissions:
# contents: read
# uses: dBildungsplattform/spsh-app-deploy/.github/workflows/get-branch-meta.yml@3

# select_helm_version_generation_and_image_tag_generation:
# create_branch_identifier:
# if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }}
# needs:
# - scan_helm
# runs-on: ubuntu-latest
# outputs:
# SELECT_HELM_VERION_GENERATION: ${{ steps.select_generation.outputs.SELECT_HELM_VERION_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_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"
# fi
# release_helm:
# if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }}
# needs:
# - select_helm_version_generation_and_image_tag_generation
# uses: dBildungsplattform/dbp-github-workflows/.github/workflows/chart-release.yaml@5
# secrets: inherit
# - branch_meta
# uses: dBildungsplattform/spsh-app-deploy/.github/workflows/deploy-branch-to-namespace.yml@3
# 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 }}

branch_meta:
if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }}
uses: dBildungsplattform/spsh-app-deploy/.github/workflows/get-branch-meta.yml@3

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
with:
branch: ${{ needs.branch_meta.outputs.branch }}

# wait_for_helm_chart_to_get_published:
# branch: ${{ needs.branch_meta.outputs.branch }}

# # wait_for_helm_chart_to_get_published:
# # needs:
# # - release_helm
# # runs-on: ubuntu-latest
# # steps:
# # - shell: bash
# # run: |
# # sleep 1m

# deploy:
# if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }}
# needs:
# - release_helm
# runs-on: ubuntu-latest
# steps:
# - shell: bash
# run: |
# sleep 1m

deploy:
if: ${{ github.event_name == 'push' && !startsWith(github.ref_name,'dependabot/') }}
needs:
- branch_meta
- create_branch_identifier
# - wait_for_helm_chart_to_get_published
uses: dBildungsplattform/spsh-app-deploy/.github/workflows/deploy.yml@DBP-952-improvements-database-deletion-job
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 }}
secrets: inherit
# - branch_meta
# - create_branch_identifier
# # - wait_for_helm_chart_to_get_published
# uses: dBildungsplattform/spsh-app-deploy/.github/workflows/deploy.yml@DBP-952-improvements-database-deletion-job
# 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 }}
# secrets: inherit






# 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
# with:
# branch: ${{ github.event.ref }}
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
with:
branch: ${{ github.event.ref }}

# delete_namespace:
# # if: comment this in to test workflow
# # if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch'}}
# needs:
# - create_branch_identifier_for_deletion
# # uses: dBildungsplattform/spsh-app-deploy/.github/workflows/delete-namespace.yml@5
# uses: dBildungsplattform/spsh-app-deploy/.github/workflows/delete-namespace.yml@DBP-952-improvements-database-deletion-job
# with:
# namespace: ${{ needs.create_branch_identifier_for_deletion.outputs.namespace_from_branch }}
# secrets:
# SPSH_DEV_KUBECONFIG: ${{ secrets.SPSH_DEV_KUBECONFIG }}
delete_namespace:
# if: comment this in to test workflow
# if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch'}}
needs:
- create_branch_identifier_for_deletion
# uses: dBildungsplattform/spsh-app-deploy/.github/workflows/delete-namespace.yml@5
uses: dBildungsplattform/spsh-app-deploy/.github/workflows/delete-namespace.yml@DBP-952-improvements-database-deletion-job
with:
namespace: ${{ needs.create_branch_identifier_for_deletion.outputs.namespace_from_branch }}
secrets:
SPSH_DEV_KUBECONFIG: ${{ secrets.SPSH_DEV_KUBECONFIG }}

# delete_successful:
# # if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch' }}
# needs:
# - delete_namespace
# - create_branch_identifier_for_deletion
# runs-on: ubuntu-latest
# steps:
# - run: echo "Deletion workflow of namespace" ${{ needs.create_branch_identifier_for_deletion.outputs.namespace_from_branch }} "done"
delete_successful:
# if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch' }}
needs:
- delete_namespace
- create_branch_identifier_for_deletion
runs-on: ubuntu-latest
steps:
- run: echo "Deletion workflow of namespace" ${{ needs.create_branch_identifier_for_deletion.outputs.namespace_from_branch }} "done"

0 comments on commit 14f5671

Please sign in to comment.