Update onix-gcp-terraform-deploy.yml
This commit is contained in:
27
.github/workflows/onix-gcp-terraform-deploy.yml
vendored
27
.github/workflows/onix-gcp-terraform-deploy.yml
vendored
@@ -16,26 +16,7 @@ jobs:
|
|||||||
- name: Clone Terraform repo from Gerrit
|
- name: Clone Terraform repo from Gerrit
|
||||||
run: |
|
run: |
|
||||||
git clone https://${{ secrets.GERRIT_USERNAME }}:${{ secrets.GERRIT_PAT }}@open-networks.googlesource.com/onix-dev gerrit-repo
|
git clone https://${{ secrets.GERRIT_USERNAME }}:${{ secrets.GERRIT_PAT }}@open-networks.googlesource.com/onix-dev gerrit-repo
|
||||||
|
echo "==== Directory contents after clone ===="
|
||||||
- name: Set up Terraform
|
ls -la
|
||||||
uses: hashicorp/setup-terraform@v3
|
echo "==== Contents of gerrit-repo ===="
|
||||||
with:
|
ls -la gerrit-repo
|
||||||
terraform_version: 1.5.0
|
|
||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
|
||||||
run: echo '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }}' > gcp-key.json
|
|
||||||
|
|
||||||
- name: Terraform Init with backend
|
|
||||||
working-directory: ./gerrit-repo/Terraform
|
|
||||||
run: |
|
|
||||||
terraform init \
|
|
||||||
-backend-config="bucket=beckn-state-bucket-bs" \
|
|
||||||
-backend-config="prefix=onix-terraform/state" \
|
|
||||||
-backend-config="credentials=${{ github.workspace }}/gcp-key.json"
|
|
||||||
|
|
||||||
- name: Terraform Plan
|
|
||||||
working-directory: ./gerrit-repo/Terraform
|
|
||||||
run: terraform plan -var="credentials_file=${{ github.workspace }}/gcp-key.json"
|
|
||||||
|
|
||||||
- name: Clean up credentials
|
|
||||||
run: rm -f gcp-key.json
|
|
||||||
|
|||||||
Reference in New Issue
Block a user