Skip to content

Commit

Permalink
ensure terraform workflows wait for lock
Browse files Browse the repository at this point in the history
  • Loading branch information
itegulov committed Jul 24, 2023
1 parent a72178c commit 0230285
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/terraform-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
# Generates an execution plan for Terraform
- name: Terraform Plan
id: plan
run: terraform plan -input=false -no-color -var-file terraform-dev.tfvars -var "credentials=$GOOGLE_CREDENTIALS"
run: terraform plan -input=false -no-color -lock-timeout=1h -var-file terraform-dev.tfvars -var "credentials=$GOOGLE_CREDENTIALS"
env:
GOOGLE_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS_DEV }}

Expand Down Expand Up @@ -126,6 +126,6 @@ jobs:
# On push to "develop", build or change infrastructure according to Terraform configuration files
- name: Terraform Apply
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
run: terraform apply -auto-approve -input=false -var-file terraform-dev.tfvars -var "credentials=$GOOGLE_CREDENTIALS"
run: terraform apply -auto-approve -input=false -lock-timeout=1h -var-file terraform-dev.tfvars -var "credentials=$GOOGLE_CREDENTIALS"
env:
GOOGLE_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS_DEV }}
2 changes: 1 addition & 1 deletion .github/workflows/terraform-feature-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
# Applies Terraform configuration to the temporary environment
- name: Terraform Apply
id: apply
run: terraform apply -auto-approve -input=false -no-color -var-file terraform-dev.tfvars -var "credentials=$GOOGLE_CREDENTIALS" -var "env=dev-$PR_NUMBER"
run: terraform apply -auto-approve -input=false -no-color -lock-timeout=1h -var-file terraform-dev.tfvars -var "credentials=$GOOGLE_CREDENTIALS" -var "env=dev-$PR_NUMBER"
env:
GOOGLE_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS_DEV }}
PR_NUMBER: ${{ env.PR_NUMBER }}
Expand Down

0 comments on commit 0230285

Please sign in to comment.