-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
72 lines (70 loc) · 2 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
71
72
trigger: none
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: Build
jobs:
- job: Build
steps:
- task: PowerShell@2
displayName: Build
inputs:
filePath: './Cicd/build.ps1'
workingDirectory: 'Cicd'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
pathtoPublish: '.build/'
artifactName: '.build'
- stage: DeployDev
dependsOn: Build
jobs:
- job: DeployDev
steps:
- task: DownloadBuildArtifacts@1
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: '.build'
downloadPath: '$(Build.SourcesDirectory)'
- task: AzureCLI@2
displayName: 'DeployDev'
inputs:
azureSubscription: 'Azure'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
export ARM_CLIENT_ID=$servicePrincipalId
export ARM_CLIENT_SECRET=$servicePrincipalKey
export ARM_TENANT_ID=$tenantId
export ARM_SUBSCRIPTION_ID=$(az account show --query 'id' --output tsv)
pwsh ./deploy.ps1 dev
addSpnToEnvironment: true
workingDirectory: 'Cicd'
failOnStandardError: true
- stage: DeployProd
dependsOn: Build
jobs:
- job: DeployProd
steps:
- task: DownloadBuildArtifacts@1
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: '.build'
downloadPath: '$(Build.SourcesDirectory)'
- task: AzureCLI@2
displayName: 'DeployProd'
inputs:
azureSubscription: 'Azure'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
export ARM_CLIENT_ID=$servicePrincipalId
export ARM_CLIENT_SECRET=$servicePrincipalKey
export ARM_TENANT_ID=$tenantId
export ARM_SUBSCRIPTION_ID=$(az account show --query 'id' --output tsv)
pwsh ./deploy.ps1 prod
addSpnToEnvironment: true
workingDirectory: 'Cicd'
failOnStandardError: true