Skip to content

Commit

Permalink
Fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zalbiraw committed Apr 28, 2024
1 parent aa61122 commit 754bc9e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 33 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
- apply
- destroy

env:
provider: ${{ inputs.cloud == 'Azure' && 'aks' || (inputs.cloud == 'AWS' && 'eks' || 'gke') }}

jobs:
cluster:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -60,17 +63,6 @@ jobs:
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}

- name: Set up provider variable based on cloud input
run: |
if [ "${{ inputs.cloud }}" = "Azure" ]; then
value="aks"
elif [ "${{ inputs.cloud }}" = "AWS" ]; then
value="eks"
elif [ "${{ inputs.cloud }}" = "GCP" ]; then
value="gke"
fi
echo "provider=$value" >> $GITHUB_ENV
- name: Create Terraform Cloud descriptors
run: cp ./${{ provider }}/terraform.cloud.tf.example ./${{ provider }}/terraform.cloud.tf

Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- Azure
- AWS
- GCP

env:
provider: ${{ inputs.cloud == 'Azure' && 'aks' || (inputs.cloud == 'AWS' && 'eks' || 'gke') }}

jobs:
destroy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -51,17 +55,6 @@ jobs:
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}

- name: Set up provider variable based on cloud input
run: |
if [ "${{ inputs.cloud }}" = "Azure" ]; then
value="aks"
elif [ "${{ inputs.cloud }}" = "AWS" ]; then
value="eks"
elif [ "${{ inputs.cloud }}" = "GCP" ]; then
value="gke"
fi
echo "provider=$value" >> $GITHUB_ENV
- name: Create Terraform Cloud descriptors
run: |
cp ./${{ provider }}/terraform.cloud.tf.example ./${{ provider }}/terraform.cloud.tf
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/full_performance_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ on:
default: false
type: boolean

env:
provider: ${{ inputs.cloud == 'Azure' && 'aks' || (inputs.cloud == 'AWS' && 'eks' || 'gke') }}

jobs:
performance_test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -67,17 +70,6 @@ jobs:
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}

- name: Set up provider variable based on cloud input
run: |
if [ "${{ inputs.cloud }}" = "Azure" ]; then
value="aks"
elif [ "${{ inputs.cloud }}" = "AWS" ]; then
value="eks"
elif [ "${{ inputs.cloud }}" = "GCP" ]; then
value="gke"
fi
echo "provider=$value" >> $GITHUB_ENV
- name: Create Terraform Cloud descriptors
run: |
cp ./${{ provider }}/terraform.cloud.tf.example ./${{ provider }}/terraform.cloud.tf
Expand Down

0 comments on commit 754bc9e

Please sign in to comment.