-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
55 lines (52 loc) · 1.92 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
trigger:
- test
pool:
vmImage: windows-latest
stages:
- stage: Lint
jobs:
- job: LintCode
displayName: Lint code
steps:
- script: |
az bicep build --file $(System.DefaultWorkingDirectory)/code/3/3.bicep
name: LintBicepCode
displayName: Run Bicep linter
- stage: test_and_build
jobs:
- job: ValidateBicepCode
displayName: Validate Bicep code
steps:
- task: AzureResourceManagerTemplateDeployment@3
inputs:
deploymentScope: 'Subscription'
azureResourceManagerConnection: 'Subskrypcja programu Visual Studio Enterprise — MPN(ff976ff1-fb9a-4806-ae13-7829c81d865a)'
subscriptionId: 'ff976ff1-fb9a-4806-ae13-7829c81d865a'
location: 'West Europe'
templateLocation: 'Linked artifact'
csmFile: '$(System.DefaultWorkingDirectory)/code/3/3.bicep'
csmParametersFile: '$(System.DefaultWorkingDirectory)/code/3/3.parameters.json'
deploymentMode: 'Validation'
deploymentName: 'ValidateDeployment'
- task: ps-rule-install@2
inputs:
module: 'PSRule.Rules.Azure'
latest: true
prerelease: false
- task: ps-rule-assert@2
continueOnError: true
inputs:
path: './code/3'
inputPath: '$(System.DefaultWorkingDirectory)/code/3/'
source: '$(System.DefaultWorkingDirectory)/code/3/'
modules: 'PSRule.Rules.Azure'
outputFormat: NUnit3
outputPath: $(System.DefaultWorkingDirectory)/TEST-template-psrule.xml
# Publish NUnit report as test results
- task: PublishTestResults@2
displayName: 'Publish PSRule results'
inputs:
testRunTitle: 'PSRule' # The title to use for the test run.
testRunner: NUnit # Import report using the NUnit format.
testResultsFiles: "$(System.DefaultWorkingDirectory)/TEST-template-psrule.xml"
failTaskOnFailedTests: true