-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathazure-pipelines.yml
98 lines (87 loc) · 3.4 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
93
94
95
96
97
parameters:
- name: buildStages
type: object
default:
- Build
- Security_FOSSA
- Security_CODEQL
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"
- repository: codeql
name: UiPath/AzurePipelinesTemplates
ref: refs/tags/uipath.security.codeql.1.8.13
type: github
endpoint: "GitHub connection"
- repository: fossa
name: UiPath/AzurePipelinesTemplates
ref: refs/tags/uipath.security.fossa.3.0.9
type: github
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:
- ${{ each stageName in parameters.buildStages }}:
- stage: ${{ stageName }}
displayName: ${{ replace(stageName, '_', ' ') }}
dependsOn: []
jobs:
- template: build.jobs.template.yml
parameters:
name: ${{ replace(stageName, 'Security_', '') }}
${{ if contains(stageName, 'Security') }}:
securityScan: ${{ replace(stageName, 'Security_', '') }}
- 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