-
Notifications
You must be signed in to change notification settings - Fork 5
/
azure-pipelines.yml
73 lines (69 loc) · 2.71 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
73
trigger:
- master
variables:
- group: uipath-cicd
- name: agent.preferPowerShellOnContainers
value: "True"
stages:
- stage: Build
displayName: Create build artifact
jobs:
- job: BuildArtifact
pool:
vmImage: "windows-latest"
container:
image: uipathrobot.azurecr.io/uipathrobot:latest
endpoint: robot-container-registry
steps:
- script: C:\UiPath\UiRobot.exe pack $(Build.SourcesDirectory)\project.json -o $(Build.ArtifactStagingDirectory)\ -v 1.0.$(Build.BuildNumber)
displayName: "Build the artifact"
- publish: $(Build.ArtifactStagingDirectory)
artifact: drop
- stage: DeployUat
displayName: Deploy build artifact to UAT
dependsOn: Build
condition: succeeded()
jobs:
- deployment: deployUat
displayName: Deploy package to UAT Orchestrator
pool:
vmImage: "windows-latest"
container:
image: uipathrobot.azurecr.io/uipathrobot:latest
endpoint: robot-container-registry
environment: uat
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: drop
displayName: Download build artifact on build agent
- powershell: |
Import-Module UiPath.Powershell
$token = Get-UiPathAuthToken -ClientId $(uatClientId) -UserKey $(uatUserKey) -AccountName $(uatAccountName) -CloudDeployment 'Production' -TenantName $(uatTenantName)
Add-UiPathPackage -PackageFile $(Pipeline.Workspace)\drop\uipath-sample.1.0.$(Build.BuildNumber).nupkg -AuthToken $token
- stage: DeployProd
displayName: Deploy build artifact to Prod
dependsOn: DeployUat
condition: succeeded()
jobs:
- deployment: deployProd
displayName: Deploy package to Prod Orchestrator
pool:
vmImage: "windows-latest"
container:
image: uipathrobot.azurecr.io/uipathrobot:latest
endpoint: robot-container-registry
environment: prod
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: drop
displayName: Download build artifact on build agent
- powershell: |
Import-Module UiPath.Powershell
$token = Get-UiPathAuthToken -ClientId $(prodClientId) -UserKey $(prodUserKey) -AccountName $(prodAccountName) -CloudDeployment 'Production' -TenantName $(prodTenantName)
Add-UiPathPackage -PackageFile $(Pipeline.Workspace)\drop\uipath-sample.1.0.$(Build.BuildNumber).nupkg -AuthToken $token