|
| 1 | +trigger: |
| 2 | + branches: |
| 3 | + include: |
| 4 | + - main |
| 5 | + |
| 6 | +jobs: |
| 7 | + - job: Build |
| 8 | + displayName: 'Build AppLocker Artifacts' |
| 9 | + pool: |
| 10 | + name: Default |
| 11 | + steps: |
| 12 | + - task: PowerShell@2 |
| 13 | + name: prereq |
| 14 | + displayName: 'Download prerequisites' |
| 15 | + inputs: |
| 16 | + filePath: '.\build\prerequisites.ps1' |
| 17 | + arguments: '-DependencyPath (Join-Path $(Build.SourcesDirectory) build\requiredModules.psd1)' |
| 18 | + - task: PowerShell@2 |
| 19 | + name: validateyaml |
| 20 | + displayName: Validate Configuration Data |
| 21 | + inputs: |
| 22 | + filePath: '.\build\validate.ps1' |
| 23 | + arguments: '-TestType ConfigurationData -DependencyPath (Join-Path $(Build.SourcesDirectory) build\requiredModules.psd1) -ProjectRoot $(Build.SourcesDirectory)' |
| 24 | + - task: PowerShell@2 |
| 25 | + name: buildpolicy |
| 26 | + displayName: Build policy XML |
| 27 | + inputs: |
| 28 | + filePath: '.\build\build.ps1' |
| 29 | + arguments: '-IncludeRsop -DependencyPath (Join-Path $(Build.SourcesDirectory) build\requiredModules.psd1) -SourcePath (Join-Path $(Build.SourcesDirectory) configurationdata) -OutputPath (Join-Path $(Build.SourcesDirectory) output)' |
| 30 | + - task: PublishBuildArtifacts@1 |
| 31 | + displayName: 'Publish Policy XML Files' |
| 32 | + inputs: |
| 33 | + PathtoPublish: 'output/Policies' |
| 34 | + ArtifactName: Policies |
| 35 | + - task: PublishBuildArtifacts@1 |
| 36 | + displayName: 'Publish Policy RSOP Files' |
| 37 | + inputs: |
| 38 | + PathtoPublish: 'output/Rsop' |
| 39 | + ArtifactName: Rsop |
| 40 | + - task: PublishTestResults@2 |
| 41 | + displayName: 'Publish Configuration Data Test Results' |
| 42 | + condition: succeededOrFailed() |
| 43 | + inputs: |
| 44 | + testResultsFormat: 'NUnit' |
| 45 | + testResultsFiles: 'tests/testresults.xml' |
| 46 | + mergeTestResults: true |
| 47 | + failTaskOnFailedTests: true |
| 48 | + testRunTitle: 'Configuration Data Tests' |
| 49 | + - deployment: Prod |
| 50 | + dependsOn: Build |
| 51 | + displayName: Prod Deployment |
| 52 | + environment: Prod |
| 53 | + pool: |
| 54 | + name: Default |
| 55 | + strategy: |
| 56 | + runOnce: |
| 57 | + deploy: |
| 58 | + steps: |
| 59 | + - task: DownloadBuildArtifacts@0 |
| 60 | + displayName: 'Download Build Artifact: Rsop' |
| 61 | + inputs: |
| 62 | + buildType: 'current' |
| 63 | + artifactName: Rsop |
| 64 | + downloadPath: $(Build.SourcesDirectory) |
| 65 | + - task: DownloadBuildArtifacts@0 |
| 66 | + displayName: 'Download Build Artifact: Policies' |
| 67 | + inputs: |
| 68 | + buildType: 'current' |
| 69 | + artifactName: Policies |
| 70 | + downloadPath: $(Build.SourcesDirectory) |
| 71 | + - task: PowerShell@2 |
| 72 | + name: publishpolicies |
| 73 | + displayName: Publish policies |
| 74 | + inputs: |
| 75 | + filePath: '.\build\publish.ps1' |
| 76 | + arguments: '-DependencyPath (Join-Path $(Build.SourcesDirectory) build\requiredModules.psd1) -SourcePath (Join-Path $(Build.SourcesDirectory) configurationdata) -OutputPath (Join-Path $(Build.SourcesDirectory) output)' |
| 77 | + - task: PowerShell@2 |
| 78 | + name: validateintegration |
| 79 | + displayName: Validate Integration |
| 80 | + inputs: |
| 81 | + filePath: '.\build\validate.ps1' |
| 82 | + arguments: '-TestType Integration -DependencyPath (Join-Path $(Build.SourcesDirectory) build\requiredModules.psd1) -ProjectRoot $(Build.SourcesDirectory)' |
| 83 | + - task: PublishTestResults@2 |
| 84 | + displayName: 'Publish Integration Test Results' |
| 85 | + condition: succeededOrFailed() |
| 86 | + inputs: |
| 87 | + testResultsFormat: 'NUnit' |
| 88 | + testResultsFiles: 'tests/testresults.xml' |
| 89 | + mergeTestResults: true |
| 90 | + failTaskOnFailedTests: true |
| 91 | + testRunTitle: 'Integration Tests' |
0 commit comments