Created
December 13, 2019 12:37
-
-
Save ehrnst/a8f97d635eb8f1d5e5a7c6f21b8fdd01 to your computer and use it in GitHub Desktop.
Yaml pipeline with powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger: | |
- master | |
variables: | |
# Agent VM image name | |
vmImageName: 'windows-2019' | |
# service connection (azure) | |
azureServiceConnection: '{{ azServiceConnection }}' | |
# SubscriptionId to use in deployment scripts | |
customerSubscriptionId: 'f1eb90a1************' | |
stages: | |
- stage: Build | |
displayName: copy files (build) | |
jobs: | |
- job: Build | |
displayName: Build | |
pool: | |
vmImage: $(vmImageName) | |
steps: | |
- task: PublishPipelineArtifact@1 | |
inputs: | |
targetPath: '$(Build.SourcesDirectory)' | |
artifact: 'drop' | |
publishLocation: 'pipeline' | |
- stage: Deploy | |
displayName: 'Deploy stage' | |
dependsOn: Build | |
jobs: | |
- deployment: Deploy | |
displayName: 'Deploy Az resources' | |
pool: | |
vmImage: $(vmImageName) | |
environment: $(customerSubscriptionId) | |
strategy: | |
runOnce: | |
deploy: | |
steps: | |
- task: DownloadPipelineArtifact@2 | |
inputs: | |
buildType: 'current' | |
artifactName: 'drop' | |
itemPattern: '**/*' | |
targetPath: '$(Pipeline.Workspace)' | |
- task: PowerShell@2 | |
inputs: | |
targetType: 'inline' | |
script: | | |
# anything here?. | |
dir | |
- task: AzurePowerShell@4 | |
displayName: 'Log analytics' | |
inputs: | |
azureSubscription: 'Azure Lighthouse BluePrint' | |
ScriptType: 'FilePath' | |
ScriptPath: '$(Pipeline.Workspace)/drop/ARM-Templates/logAnalytics/deploy.ps1' | |
ScriptArguments: '-subscriptionId $(customerSubscriptionId)' | |
azurePowerShellVersion: 'LatestVersion' | |
pwsh: true | |
- task: AzurePowerShell@4 | |
displayName: 'Security center' | |
inputs: | |
azureSubscription: 'Azure Lighthouse BluePrint' | |
ScriptType: 'FilePath' | |
ScriptPath: '$(Pipeline.Workspace)/drop/ARM-Templates/securityCenter/deploy.ps1' | |
ScriptArguments: '-subscriptionId $(customerSubscriptionId)' | |
azurePowerShellVersion: 'LatestVersion' | |
pwsh: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment