Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
ensure auth tokens are available during CI plan phase
Browse files Browse the repository at this point in the history
  • Loading branch information
displague authored Jun 3, 2024
1 parent 4051895 commit 22d6fbf
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ jobs:
- name: Terraform Vars - Cluster Name
run: echo "TF_VAR_vcenter_cluster_name=tfacc-${SHORT_SHA}" >> $GITHUB_ENV
- name: Terraform Vars - Project ID
run: echo "TF_VAR_project_id=${{ steps.project.outputs.projectID }}" >> $GITHUB_ENV
run: |
echo "TF_VAR_project_id=${{ steps.project.outputs.projectID }}" >> $GITHUB_ENV
echo "METAL_AUTH_TOKEN: ${{ steps.project.outputs.projectToken }}" >> $GITHUB_ENV # used by Equinix provider when auth_token not specified
echo "TF_VAR_auth_token: ${{ steps.project.outputs.projectToken }}" >> $GITHUB_ENV
echo "TF_VAR_s3_url: ${{ secrets.S3_URL }}" >> $GITHUB_ENV
echo "TF_VAR_object_store_bucket_name: ${{ secrets.S3_BUCKET_NAME }}" >> $GITHUB_ENV
echo "TF_VAR_s3_access_key: ${{ secrets.S3_ACCESS_KEY }}" >> $GITHUB_ENV
echo "TF_VAR_s3_secret_key: ${{ secrets.S3_SECRET_KEY }}" >> $GITHUB_ENV
- name: Terraform Plan
id: plan
timeout-minutes: 120
Expand All @@ -71,21 +78,11 @@ jobs:
timeout-minutes: 120
continue-on-error: true
run: terraform apply -input=false tfplan
env:
METAL_AUTH_TOKEN: ${{ steps.project.outputs.projectToken }} # used by Equinix provider when auth_token not specified
TF_VAR_auth_token: ${{ steps.project.outputs.projectToken }}
TF_VAR_s3_url: ${{ secrets.S3_URL }}
TF_VAR_object_store_bucket_name: ${{ secrets.S3_BUCKET_NAME }}
TF_VAR_s3_access_key: ${{ secrets.S3_ACCESS_KEY }}
TF_VAR_s3_secret_key: ${{ secrets.S3_SECRET_KEY }}
- name: Terraform Destroy
continue-on-error: true
id: destroy
if: ${{ always() }}
run: terraform destroy -input=false -auto-approve
env:
TF_VAR_auth_token: ${{ steps.project.outputs.projectToken }}
METAL_AUTH_TOKEN: ${{ steps.project.outputs.projectToken }}
- name: Project Delete
if: ${{ always() }}
uses: equinix-labs/metal-sweeper-action@v0.6.1
Expand Down

0 comments on commit 22d6fbf

Please sign in to comment.