forked from jenkinsci/uipath-automation-package-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
93 lines (82 loc) · 3.3 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
trigger:
batch: true
branches:
include:
- master
- develop
- release/*
pr:
branches:
include:
- master
- develop
- release/*
resources:
repositories:
- repository: common
type: github
name: UiPath/AzurePipelinesTemplates
ref: master
endpoint: "GitHub connection"
variables:
JENKINS_HOME: 'C:\Windows\System32\config\systemprofile\.jenkins'
MavenPOMFile: '$(Build.SourcesDirectory)\pom.xml'
AlphaBetaPluginVersionCounter: $[ format('{0}', counter('uipjenkinstaskversion', 1)) ]
TestProjectPath: '$(Build.SourcesDirectory)\Qa\UiPath.JenkinsAutomationPackage.Tests\project.json'
TestConfigurationData: "{\"Publishers\":[{\"Type\":\"JUnit\",\"Arguments\":\"outputFile=junitResults.xml;reportSkippedTestSuite=False\"}], \"VideoRecorderType\": \"ffmpeg\", \"VideoRecorderPath\": \"C:\\\\\\\\ffmpeg\\\\\\\\ffmpeg.exe\"}"
stages:
- stage: Build
displayName: "Build CLI package"
jobs:
- job: BuildAndPublishArtifacts
displayName: 'Build'
timeoutInMinutes: 90
workspace:
clean: outputs
variables:
MavenPOMFile: '$(Build.SourcesDirectory)/pom.xml'
pool:
vmImage: windows-2022
demands:
- maven
steps:
- template: job.ci.build.yml
- ${{ if or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/develop'), startsWith(variables['Build.SourceBranch'], 'refs/heads/masters/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/support/')) }}:
- stage: BuildSecurityScan
displayName: Build and Security Scan
dependsOn: []
jobs:
- template: stage.security.yml
- stage: Deploy
displayName: "Deploy on Jenkins server"
dependsOn: Build
jobs:
- deployment: DeployJenkinsPlugin
displayName: 'Deploy the new jenkins plugin'
environment: JenkinsCITest
timeoutInMinutes: 90
workspace:
clean: outputs
variables:
MavenPOMFile: '$(Build.SourcesDirectory)/pom.xml'
pool:
vmImage: ubuntu-latest
strategy:
runOnce:
deploy:
steps:
- checkout: none
- download: current
displayName: 'Download Packages'
artifact: Packages
- powershell: |
az storage blob upload -f $(Agent.BuildDirectory)/Packages/uipath-automation-package.hpi -c $(ContainerName) -n $(Build.BuildNumber)/uipath-automation-package.hpi --account-name $(AzureAccountName) --auth-mode key --account-key $(StorageAccountKey) --overwrite
displayName: "Upload plugin package to blob storage"
- bash: |
set -e
wget $(JenkinsUrl)/jnlpJars/jenkins-cli.jar
java -jar jenkins-cli.jar -s $(JenkinsUrl) -auth $(JenkinsUsername):$(JenkinsAuthToken) install-plugin https://$(AzureAccountName).blob.core.windows.net/$(ContainerName)/$(Build.BuildNumber)/uipath-automation-package.hpi -restart
end=$((SECONDS+300)); while [[ "$(curl -k -s -o /dev/null -w ''%{http_code}'' $(JenkinsUrl)/login)" != "200" ]]; do if [[ $SECONDS -gt $end ]]; then echo "Operation timed out of checking p
lugin installation status"; break; fi; echo "waiting for plugin to install" && sleep 5; done
displayName: "Install package on Jenkins server"
- template: stage.test.yml