|
| 1 | +trigger: |
| 2 | + branches: |
| 3 | + include: |
| 4 | + - main |
| 5 | + |
| 6 | +stages: |
| 7 | + - stage: build |
| 8 | + jobs: |
| 9 | + - job: Build |
| 10 | + displayName: 'Build AppLocker Artifacts' |
| 11 | + pool: |
| 12 | + name: Default |
| 13 | + workspace: |
| 14 | + clean: all |
| 15 | + steps: |
| 16 | + - task: PowerShell@2 |
| 17 | + name: build |
| 18 | + displayName: 'Download prerequisites' |
| 19 | + inputs: |
| 20 | + filePath: '.\build\vsts-prerequisites.ps1' |
| 21 | + - task: PowerShell@2 |
| 22 | + name: build |
| 23 | + displayName: Validate Configuration Data |
| 24 | + inputs: |
| 25 | + filePath: '.\build\vsts-validate.ps1' |
| 26 | + arguments: '-TestType ConfigurationData' |
| 27 | + - task: PowerShell@2 |
| 28 | + name: build |
| 29 | + displayName: Build policy XML |
| 30 | + inputs: |
| 31 | + filePath: '.\build\vsts-build.ps1' |
| 32 | + arguments: '-IncludeRsop' |
| 33 | + |
| 34 | + - task: PublishBuildArtifacts@1 |
| 35 | + displayName: 'Publish Policy XML Files' |
| 36 | + inputs: |
| 37 | + PathtoPublish: 'output/Policies' |
| 38 | + ArtifactName: Policies |
| 39 | + |
| 40 | + - task: PublishBuildArtifacts@1 |
| 41 | + displayName: 'Publish Policy RSOP Files' |
| 42 | + inputs: |
| 43 | + PathtoPublish: 'output/Rsop' |
| 44 | + ArtifactName: Rsop |
| 45 | + |
| 46 | + - stage: publish |
| 47 | + dependsOn: build |
| 48 | + jobs: |
| 49 | + - deployment: Dev |
| 50 | + displayName: Dev Deployment |
| 51 | + environment: Dev |
| 52 | + pool: |
| 53 | + name: Default |
| 54 | + workspace: |
| 55 | + clean: all |
| 56 | + strategy: |
| 57 | + runOnce: |
| 58 | + deploy: |
| 59 | + steps: |
| 60 | + - download: None |
| 61 | + |
| 62 | + - task: DownloadBuildArtifacts@0 |
| 63 | + displayName: 'Download Build Artifact: Rsop' |
| 64 | + inputs: |
| 65 | + buildType: 'current' |
| 66 | + artifactName: Rsop |
| 67 | + downloadPath: $(Build.SourcesDirectory) |
| 68 | + - task: DownloadBuildArtifacts@0 |
| 69 | + displayName: 'Download Build Artifact: Policies' |
| 70 | + inputs: |
| 71 | + buildType: 'current' |
| 72 | + artifactName: Policies |
| 73 | + downloadPath: $(Build.SourcesDirectory) |
| 74 | + - task: PowerShell@2 |
| 75 | + name: publishpolicies |
| 76 | + displayName: Publish policies |
| 77 | + inputs: |
| 78 | + filePath: '.\build\vsts-publish.ps1' |
| 79 | + arguments: '-OutputPath $(Build.SourcesDirectory)' |
| 80 | + |
| 81 | + - stage: DscDeploymentTest |
| 82 | + dependsOn: |
| 83 | + - build |
| 84 | + - DscDeploymentDev |
| 85 | + jobs: |
| 86 | + - deployment: Test |
| 87 | + displayName: Test Deployment |
| 88 | + environment: Test |
| 89 | + pool: |
| 90 | + name: Default |
| 91 | + workspace: |
| 92 | + clean: all |
| 93 | + strategy: |
| 94 | + runOnce: |
| 95 | + deploy: |
| 96 | + steps: |
| 97 | + - download: None |
| 98 | + |
| 99 | + - task: DownloadBuildArtifacts@0 |
| 100 | + displayName: 'Download Build Artifact: MOF' |
| 101 | + inputs: |
| 102 | + buildType: 'current' |
| 103 | + artifactName: MOF |
| 104 | + downloadPath: $(Build.SourcesDirectory) |
| 105 | + |
| 106 | + - task: CopyFiles@2 |
| 107 | + name: DeployMofsToPullServer |
| 108 | + displayName: 'Deploy MOF Files to Pull Server' |
| 109 | + inputs: |
| 110 | + SourceFolder: '$(Build.SourcesDirectory)/MOF/$(Environment.Name)' |
| 111 | + Contents: '**' |
| 112 | + TargetFolder: '\\dscpull01\DscConfiguration' |
| 113 | + OverWrite: true |
| 114 | + |
| 115 | + - stage: DscDeploymentProd |
| 116 | + dependsOn: |
| 117 | + - build |
| 118 | + - DscDeploymentTest |
| 119 | + jobs: |
| 120 | + - deployment: Prod |
| 121 | + displayName: Prodt Deployment |
| 122 | + environment: Prod |
| 123 | + pool: |
| 124 | + name: Default |
| 125 | + workspace: |
| 126 | + clean: all |
| 127 | + strategy: |
| 128 | + runOnce: |
| 129 | + deploy: |
| 130 | + steps: |
| 131 | + - download: None |
| 132 | + |
| 133 | + - task: DownloadBuildArtifacts@0 |
| 134 | + displayName: 'Download Build Artifact: MOF' |
| 135 | + inputs: |
| 136 | + buildType: 'current' |
| 137 | + artifactName: MOF |
| 138 | + downloadPath: $(Build.SourcesDirectory) |
| 139 | + |
| 140 | + - task: CopyFiles@2 |
| 141 | + name: DeployMofsToPullServer |
| 142 | + displayName: 'Deploy MOF Files to Pull Server' |
| 143 | + inputs: |
| 144 | + SourceFolder: '$(Build.SourcesDirectory)/MOF/$(Environment.Name)' |
| 145 | + Contents: '**' |
| 146 | + TargetFolder: '\\dscpull01\DscConfiguration' |
| 147 | + OverWrite: true |
0 commit comments