Skip to content

Commit

Permalink
BC-6013 - update workflows for dev cluster by tenant (#735)
Browse files Browse the repository at this point in the history
* BC-6013 - update workflows for dev cluster by tenant

* BC-6013 - fix kubeconfig error

* BC-6013 - move namespace remove to owne file

* BC-6013 - back to one job

* BC-6013 - remove not used file
  • Loading branch information
mamutmk5 authored Dec 12, 2023
1 parent 291e396 commit 5256a58
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 29 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ jobs:
branch: ${{ needs.branch_name.outputs.branch }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
DEV_KUBE_CONFIG: ${{ secrets.DEV_KUBE_CONFIG }}
DEV_KUBE_CONFIG_BRB: ${{ secrets.DEV_KUBE_CONFIG_BRB }}
DEV_KUBE_CONFIG_NBC: ${{ secrets.DEV_KUBE_CONFIG_NBC }}
DEV_KUBE_CONFIG_THR: ${{ secrets.DEV_KUBE_CONFIG_THR }}
DEV_KUBE_CONFIG_DBC: ${{ secrets.DEV_KUBE_CONFIG_DBC }}
BINGO_REPO_TOKEN: ${{ secrets.BINGO_REPO_TOKEN }}
5 changes: 4 additions & 1 deletion .github/workflows/clean_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ jobs:
branch: ${{ github.event.ref }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
DEV_KUBE_CONFIG: ${{ secrets.DEV_KUBE_CONFIG }}
DEV_KUBE_CONFIG_BRB: ${{ secrets.DEV_KUBE_CONFIG_BRB }}
DEV_KUBE_CONFIG_NBC: ${{ secrets.DEV_KUBE_CONFIG_NBC }}
DEV_KUBE_CONFIG_THR: ${{ secrets.DEV_KUBE_CONFIG_THR }}
DEV_KUBE_CONFIG_DBC: ${{ secrets.DEV_KUBE_CONFIG_DBC }}
BINGO_REPO_TOKEN: ${{ secrets.BINGO_REPO_TOKEN }}
38 changes: 23 additions & 15 deletions .github/workflows/clean_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ on:
secrets:
token:
required: true
DEV_KUBE_CONFIG:
DEV_KUBE_CONFIG_BRB:
required: true
DEV_KUBE_CONFIG_NBC:
required: true
DEV_KUBE_CONFIG_THR:
required: true
DEV_KUBE_CONFIG_DBC:
required: true
BINGO_REPO_TOKEN:
required: true
Expand Down Expand Up @@ -120,22 +126,24 @@ jobs:
steps:
- run: |
mkdir files
echo "${{ secrets.DEV_KUBE_CONFIG }}" > files/config
echo "${{ secrets.DEV_KUBE_CONFIG_BRB }}" > files/config_brb
echo "${{ secrets.DEV_KUBE_CONFIG_NBC }}" > files/config_nbc
echo "${{ secrets.DEV_KUBE_CONFIG_DBC }}" > files/config_dbc
- name: delete custom resources and namespaces
run: |
branch_identifier='${{ needs.create_branch_identifier.outputs.id_branch }}'
kubectl --kubeconfig=files/config --namespace brb-$branch_identifier delete --ignore-not-found=true --all=true ScaledObject
kubectl --kubeconfig=files/config --namespace nbc-$branch_identifier delete --ignore-not-found=true --all=true ScaledObject
kubectl --kubeconfig=files/config --namespace default-$branch_identifier delete --ignore-not-found=true --all=true ScaledObject
kubectl --kubeconfig=files/config --namespace brb-$branch_identifier delete --ignore-not-found=true --all=true TriggerAuthentication
kubectl --kubeconfig=files/config --namespace nbc-$branch_identifier delete --ignore-not-found=true --all=true TriggerAuthentication
kubectl --kubeconfig=files/config --namespace default-$branch_identifier delete --ignore-not-found=true --all=true TriggerAuthentication
kubectl --kubeconfig=files/config --namespace brb-$branch_identifier delete --ignore-not-found=true --all=true OnePasswordItem
kubectl --kubeconfig=files/config --namespace nbc-$branch_identifier delete --ignore-not-found=true --all=true OnePasswordItem
kubectl --kubeconfig=files/config --namespace default-$branch_identifier delete --ignore-not-found=true --all=true OnePasswordItem
kubectl --kubeconfig=files/config delete --ignore-not-found=true ns brb-$branch_identifier nbc-$branch_identifier default-$branch_identifier
kubectl --kubeconfig=files/config_brb --namespace brb-$branch_identifier delete --ignore-not-found=true --all=true ScaledObject
kubectl --kubeconfig=files/config_brb --namespace brb-$branch_identifier delete --ignore-not-found=true --all=true TriggerAuthentication
kubectl --kubeconfig=files/config_brb --namespace brb-$branch_identifier delete --ignore-not-found=true --all=true OnePasswordItem
kubectl --kubeconfig=files/config_brb delete --ignore-not-found=true ns brb-$branch_identifier
kubectl --kubeconfig=files/config_nbc --namespace nbc-$branch_identifier delete delete --ignore-not-found=true --all=true ScaledObject
kubectl --kubeconfig=files/config_nbc --namespace nbc-$branch_identifier delete delete --ignore-not-found=true --all=true TriggerAuthentication
kubectl --kubeconfig=files/config_nbc --namespace nbc-$branch_identifier delete delete --ignore-not-found=true --all=true OnePasswordItem
kubectl --kubeconfig=files/config_nbc delete --ignore-not-found=true ns nbc-$branch_identifier delete
kubectl --kubeconfig=files/config_dbc --namespace default-$branch_identifier delete --ignore-not-found=true --all=true ScaledObject
kubectl --kubeconfig=files/config_dbc --namespace default-$branch_identifier} delete --ignore-not-found=true --all=true TriggerAuthentication
kubectl --kubeconfig=files/config_dbc --namespace default-$branch_identifier delete --ignore-not-found=true --all=true OnePasswordItem
kubectl --kubeconfig=files/config_dbc delete --ignore-not-found=true ns default-$branch_identifier
- name: remove kubeconfig
run: |
rm -rf /config
rm -rf files/config_.*
28 changes: 20 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,21 @@ on:
secrets:
token:
required: true
DEV_VAULT:
DEV_VAULT_BRB:
required: true
DEV_KUBE_CONFIG:
DEV_VAULT_THR:
required: true
DEV_VAULT_NBC:
required: true
DEV_VAULT_DBC:
required: true
DEV_KUBE_CONFIG_BRB:
required: true
DEV_KUBE_CONFIG_NBC:
required: true
DEV_KUBE_CONFIG_THR:
required: true
DEV_KUBE_CONFIG_DBC:
required: true
BINGO_REPO_TOKEN:
required: true
Expand Down Expand Up @@ -128,8 +140,8 @@ jobs:
host_name: default_host
tenannt: dbc
secrets:
ONEPASSWORD_VAULT: ${{ secrets.DEV_VAULT }}
KUBECONFIG: ${{ secrets.DEV_KUBE_CONFIG }}
ONEPASSWORD_VAULT: ${{ secrets.DEV_VAULT_DBC }}
KUBECONFIG: ${{ secrets.DEV_KUBE_CONFIG_DBC }}

deploy_nbc_dev:
needs:
Expand All @@ -140,8 +152,8 @@ jobs:
host_name: nbc_host
tenannt: nbc
secrets:
ONEPASSWORD_VAULT: ${{ secrets.DEV_VAULT }}
KUBECONFIG: ${{ secrets.DEV_KUBE_CONFIG }}
ONEPASSWORD_VAULT: ${{ secrets.DEV_VAULT_NBC }}
KUBECONFIG: ${{ secrets.DEV_KUBE_CONFIG_NBC }}

deploy_brb_dev:
needs:
Expand All @@ -152,5 +164,5 @@ jobs:
host_name: brb_host
tenannt: brb
secrets:
ONEPASSWORD_VAULT: ${{ secrets.DEV_VAULT }}
KUBECONFIG: ${{ secrets.DEV_KUBE_CONFIG }}
ONEPASSWORD_VAULT: ${{ secrets.DEV_VAULT_BRB }}
KUBECONFIG: ${{ secrets.DEV_KUBE_CONFIG_BRB }}
10 changes: 8 additions & 2 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ jobs:
branch: ${{ needs.branch_name.outputs.branch }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
DEV_VAULT: ${{ secrets.DEV_VAULT }}
DEV_KUBE_CONFIG: ${{ secrets.DEV_KUBE_CONFIG }}
DEV_VAULT_BRB: ${{ secrets.DEV_VAULT_BRB }}
DEV_VAULT_NBC: ${{ secrets.DEV_VAULT_NBC }}
DEV_VAULT_THR: ${{ secrets.DEV_VAULT_THR }}
DEV_VAULT_DBC: ${{ secrets.DEV_VAULT_DBC }}
DEV_KUBE_CONFIG_BRB: ${{ secrets.DEV_KUBE_CONFIG_BRB }}
DEV_KUBE_CONFIG_NBC: ${{ secrets.DEV_KUBE_CONFIG_NBC }}
DEV_KUBE_CONFIG_THR: ${{ secrets.DEV_KUBE_CONFIG_THR }}
DEV_KUBE_CONFIG_DBC: ${{ secrets.DEV_KUBE_CONFIG_DBC }}

10 changes: 8 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ jobs:
branch: ${{ needs.branch_name.outputs.branch }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
DEV_VAULT: ${{ secrets.DEV_VAULT }}
DEV_KUBE_CONFIG: ${{ secrets.DEV_KUBE_CONFIG }}
DEV_VAULT_BRB: ${{ secrets.DEV_VAULT_BRB }}
DEV_VAULT_NBC: ${{ secrets.DEV_VAULT_NBC }}
DEV_VAULT_THR: ${{ secrets.DEV_VAULT_THR }}
DEV_VAULT_DBC: ${{ secrets.DEV_VAULT_DBC }}
DEV_KUBE_CONFIG_BRB: ${{ secrets.DEV_KUBE_CONFIG_BRB }}
DEV_KUBE_CONFIG_NBC: ${{ secrets.DEV_KUBE_CONFIG_NBC }}
DEV_KUBE_CONFIG_THR: ${{ secrets.DEV_KUBE_CONFIG_THR }}
DEV_KUBE_CONFIG_DBC: ${{ secrets.DEV_KUBE_CONFIG_DBC }}
BINGO_REPO_TOKEN: ${{ secrets.BINGO_REPO_TOKEN }}

deploy-successful:
Expand Down

0 comments on commit 5256a58

Please sign in to comment.