-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #784 from cal-itp/feat/azure-pipeline-tf
run continuous integration of Terraform
- Loading branch information
Showing
3 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
trigger: | ||
# automatically runs on pull requests; this runs the pipeline after merge | ||
# https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#pr-triggers | ||
branches: | ||
include: | ||
- dev | ||
# only run for changes to Terraform files | ||
paths: | ||
include: | ||
- terraform/* | ||
stages: | ||
- stage: plan | ||
pool: | ||
vmImage: ubuntu-latest | ||
jobs: | ||
- job: plan | ||
steps: | ||
# https://github.com/microsoft/azure-pipelines-terraform/tree/main/Tasks/TerraformInstaller#readme | ||
- task: TerraformInstaller@0 | ||
displayName: Install Terraform | ||
inputs: | ||
terraformVersion: 1.2.4 | ||
# https://github.com/microsoft/azure-pipelines-terraform/tree/main/Tasks/TerraformTask/TerraformTaskV3#readme | ||
- task: TerraformTaskV3@3 | ||
displayName: Terraform init | ||
inputs: | ||
provider: "azurerm" | ||
command: "init" | ||
workingDirectory: "$(System.DefaultWorkingDirectory)/terraform" | ||
# service connection | ||
backendServiceArm: "Production" | ||
# needs to match main.tf | ||
backendAzureRmResourceGroupName: "RG-CDT-PUB-VIP-CALITP-P-001" | ||
backendAzureRmStorageAccountName: "sacdtcalitpp001" | ||
backendAzureRmContainerName: "tfstate" | ||
backendAzureRmKey: "terraform.tfstate" | ||
- task: TerraformTaskV3@3 | ||
displayName: Terraform plan | ||
inputs: | ||
provider: "azurerm" | ||
command: "plan" | ||
workingDirectory: "$(System.DefaultWorkingDirectory)/terraform" | ||
# service connection | ||
environmentServiceNameAzureRM: "Production" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters