Skip to content

Instantly share code, notes, and snippets.

@carljavier
Created May 31, 2022 10:37
Show Gist options
  • Save carljavier/61e96aa7e012d5860c81a6a7a5f8484d to your computer and use it in GitHub Desktop.
Save carljavier/61e96aa7e012d5860c81a6a7a5f8484d to your computer and use it in GitHub Desktop.
Azure DevOps TF Pipeline
trigger:
- master
pool:
vmImage: ubuntu-latest
steps:
- script: echo Starting Terraform Run
- task: TerraformInstaller@0
inputs:
terraformVersion: 'latest'
displayName: 'Starting Terraform'
- task: TerraformCLI@0
name: TF_Version
inputs:
command: 'version'
allowTelemetryCollection: true
- task: TerraformCLI@0
name: TF_fmt
inputs:
command: 'fmt'
commandOptions: '-check'
allowTelemetryCollection: true
- task: TerraformCLI@0
name: TF_init
env:
TF_TOKEN_app_terraform_io: $(TF_TOKEN_APP_TERRAFORM_IO)
inputs:
command: 'init'
backendType: 'selfConfigured'
allowTelemetryCollection: true
- task: TerraformCLI@0
name: TF_validate
env:
TF_TOKEN_app_terraform_io: $(TF_TOKEN_APP_TERRAFORM_IO)
inputs:
command: 'validate'
allowTelemetryCollection: true
- task: TerraformCLI@0
name: TF_plan
env:
TF_TOKEN_app_terraform_io: $(TF_TOKEN_APP_TERRAFORM_IO)
inputs:
command: 'plan'
allowTelemetryCollection: true
- task: TerraformCLI@0
name: TF_apply
env:
TF_TOKEN_app_terraform_io: $(TF_TOKEN_APP_TERRAFORM_IO)
inputs:
command: 'apply'
allowTelemetryCollection: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment