-
Notifications
You must be signed in to change notification settings - Fork 28
78 lines (72 loc) · 2.65 KB
/
call-provision-btp-cluster.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Provision BTP Cluster
on:
workflow_dispatch:
inputs:
btp_kyma_plan:
description: 'Service plan of the kyma environment'
required: true
type: choice
default: "aws"
options:
- aws
- azure
- gcp
- sap-converged-cloud
custom_administrators:
description: 'List of custom administrators.
Provide as a JSON array of strings (e.g. ["[email protected]", "[email protected]"])'
required: false
default: "[]"
type: string
jobs:
provision-btp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Use region specific for the Kyma plan
id: get-region
shell: bash
run: |
case '${{ inputs.btp_kyma_plan }}' in
"aws")
echo "region=eu-central-1" >> $GITHUB_OUTPUT
;;
"azure")
echo "region=westeurope" >> $GITHUB_OUTPUT
;;
"gcp")
echo "region=europe-west3" >> $GITHUB_OUTPUT
;;
"sap-converged-cloud")
echo "region=eu-de-1" >> $GITHUB_OUTPUT
;;
*)
exit 1
;;
esac
- uses: ./.github/actions/create-sap-btp-kyma
id: create-btp-resources
with:
btp_kyma_plan: '${{ inputs.btp_kyma_plan }}'
btp_kyma_region: '${{ steps.get-region.outputs.region }}'
btp_kyma_autoscaler_min: 4
btp_global_account: '${{ secrets.BTP_GLOBAL_ACCOUNT }}'
btp_subaccount_name: gha-${{ github.job }}-${{ github.run_id }}-${{ github.run_attempt }}
btp_subaccount_region: '${{ secrets.BTP_SUBACCOUNT_REGION }}'
btp_backend_url: '${{ secrets.BTP_BACKEND_URL}}'
btp_idp_tenant: '${{ secrets.BTP_CUSTOM_IAS_TENANT }}'
btp_user: '${{ secrets.BTP_BOT_USER}}'
btp_password: '${{ secrets.BTP_BOT_PASSWORD}}'
btp_kyma_administrators: '${{ inputs.custom_administrators }}'
- name: deploy resources
shell: bash
run: |
kubectl apply -f ./.github/actions/create-sap-btp-kyma/mock-oauth2.yaml
kubectl apply -f ./.github/actions/create-sap-btp-kyma/deployments.yaml
kubectl apply -f ./.github/actions/create-sap-btp-kyma/jobs.yaml
- name: Output subaccount name
shell: bash
run: echo "subaccount_name=gha-${{ github.job }}-${{ github.run_id }}-${{ github.run_attempt }}" >> $GITHUB_STEP_SUMMARY