Skip to content
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

Ensure terraform cli exists in the runner #67

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/create-sap-btp-kyma/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ inputs:
description: 'Minimum numbers of worker nodes the new kyma environment shoud start with'
required: false
default: '3'
btp_kyma_administrators:
description: 'String representation of the kyma admin list'
required: false
default: "[]"

outputs:
subaccount_id:
Expand All @@ -46,6 +50,24 @@ outputs:
runs:
using: 'composite'
steps:
- name: ensure terraform cli
shell: bash
run: |
if ! which terraform; then
sudo apt-get update && sudo apt-get install -y gnupg software-properties-common
wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null
gpg --no-default-keyring \
--keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
--fingerprint
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update
sudo apt-get install terraform
fi
terraform -help
- name: Create btp resources
id: create-btp-resources
run: |
Expand All @@ -68,4 +90,5 @@ runs:
TF_VAR_BTP_KYMA_REGION: ${{ inputs.btp_kyma_region }}
TF_VAR_BTP_KYMA_MODULES_STRINGIFIED: ${{ inputs.btp_kyma_modules }}
TF_VAR_BTP_KYMA_AUTOSCALER_MIN: ${{ inputs.btp_kyma_autoscaler_min }}
TF_VAR_BTP_KYMA_CUSTOM_ADMINISTRATORS: ${{ inputs.btp_kyma_administrators }}

1 change: 1 addition & 0 deletions .github/actions/create-sap-btp-kyma/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module "kyma" {
BTP_NEW_SUBACCOUNT_REGION = var.BTP_NEW_SUBACCOUNT_REGION
BTP_KYMA_MODULES = jsondecode(var.BTP_KYMA_MODULES_STRINGIFIED)
BTP_KYMA_AUTOSCALER_MIN = var.BTP_KYMA_AUTOSCALER_MIN
BTP_KYMA_CUSTOM_ADMINISTRATORS = jsondecode(var.BTP_KYMA_CUSTOM_ADMINISTRATORS)
}

output "subaccount_id" {
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/create-sap-btp-kyma/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@ variable "BTP_KYMA_MODULES_STRINGIFIED" {
variable "BTP_KYMA_AUTOSCALER_MIN" {
type = number
default = 3
}

variable "BTP_KYMA_CUSTOM_ADMINISTRATORS" {
type = string
description = "Emails of kyma admins stringified array"
}
Loading