This repository has been archived by the owner on Oct 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathazure-pipelines.yml
70 lines (64 loc) · 2.31 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
# Docs:
# https://aka.ms/yaml
trigger:
batch: true
branches:
include:
- master
variables:
serviceConnection: azurerm-nonprod
keyvaultName: infra-vault-nonprod
terraformVersion: 0.12.8
agentPool: 'ubuntu-latest'
stages:
- stage: CI
jobs:
- job: Validate
pool:
vmImage: ${{ variables.agentPool }}
steps:
- task: Bash@3
displayName: "Set build number"
inputs:
filePath: 'ci/set-build-pipeline-name.sh'
- task: PowerShell@2
displayName: 'Run tests'
inputs:
targetType: 'inline'
script: |
Install-Module -Name Pester -MaximumVersion 4.99.99 -Force -Verbose -Scope CurrentUser
Invoke-Pester ./ci -OutputFormat NUnitXml -OutputFile ./TEST-CI.xml -EnableExit
failOnStderr: true
pwsh: true
- task: AzureKeyVault@1
displayName: 'Get azure devops API token from Keyvault'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
azureSubscription: ${{ variables.serviceConnection }}
keyVaultName: ${{ variables.keyvaultName }}
secretsFilter: 'azure-devops-token'
- task: Bash@3
displayName: "Update or Create Variable Groups"
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
filePath: 'variablegroups/scripts/update-variable-groups.sh'
arguments: '$(azure-devops-token)'
workingDirectory: 'variablegroups/'
- task: PublishTestResults@2
displayName: 'Publish Test Results **/TEST-*.xml'
inputs:
testResultsFormat: NUnit
failTaskOnFailedTests: true
condition: always()
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
Contents: |
deployments/**
roles/**
scripts/**
templates/**
tests/**
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'