-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipelines.yml
90 lines (81 loc) · 2.24 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Docs:
# https://aka.ms/yaml
trigger:
batch: true
branches:
include:
- master
paths:
include:
- modules/*
- pipeline-scripts/*
- pipeline-templates/*
- azure-pipelines.yml
- main.tf
- provider.tf
- terraform.tfvars
- variables.tf
pr:
branches:
include:
- '*'
paths:
include:
- modules/*
- pipeline-scripts/*
- pipeline-templates/*
- azure-pipelines.yml
- main.tf
- provider.tf
- terraform.tfvars
- variables.tf
resources:
repositories:
- repository: cnp-azuredevops-libraries
type: github
ref: refs/heads/master
name: hmcts/cnp-azuredevops-libraries
endpoint: 'hmcts'
variables:
terraformVersion: 1.2.3
agentPool: 'ubuntu-latest'
timeoutInMinutes: 60
stages:
- stage: Precheck
jobs:
- job: Precheck
pool:
vmImage: ${{ variables.agentPool }}
timeoutInMinutes: ${{ variables.timeoutInMinutes }}
steps:
- template: steps/terraform-precheck.yaml@cnp-azuredevops-libraries
parameters:
keyvaultName: 'infra-vault-nonprod'
keyvaultSecret: 'azure-devops-sp-token'
serviceConnection: 'azurerm-sandbox'
- stage: GetArtifacts
jobs:
- template: pipeline-templates/terraform-plan.yaml
parameters:
build: $(Build.BuildNumber)
agentPool: ${{ variables.agentPool }}
terraformVersion: ${{ variables.terraformVersion }}
- job: Archive
pool:
vmImage: ${{ variables.agentPool }}
steps:
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
- stage: ApplyLaunchdarkly
dependsOn: GetArtifacts
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- template: pipeline-templates/terraform-apply.yaml
parameters:
build: $(Build.BuildNumber)
agentPool: ${{ variables.agentPool }}
terraformVersion: ${{ variables.terraformVersion }}