|
1 | 1 | String d = "docs/tutorials/jenkins/parallel-robot-pipeline" |
2 | 2 |
|
3 | 3 | pipeline { |
4 | | - agent any |
5 | | - parameters { |
6 | | - string( |
7 | | - name: 'URL', |
8 | | - defaultValue: '', |
9 | | - description: 'Target URL for the Robot Framework tasks') |
10 | | - } |
11 | | - stages { |
12 | | - stage('Run tasks') { |
13 | | - parallel { |
14 | | - stage('Chromium') { |
15 | | - agent { docker { |
16 | | - image 'ghcr.io/cicd-tutorials/robot-browser:latest' |
17 | | - args '--entrypoint=""' |
18 | | - reuseNode true |
19 | | - } } |
20 | | - steps { |
21 | | - sh "robot -d robot_output -l none -r none -o chromium.xml -N Chromium -v URL:${params.URL} --nostatusrc $d/suites/" |
22 | | - // If reuseNode true was not used, we would have to stash the output XML. |
23 | | - // stash includes: 'robot_output/**', name: 'Chromium' |
24 | | - } |
25 | | - } |
26 | | - stage('Firefox') { |
27 | | - agent { docker { |
28 | | - image 'ghcr.io/cicd-tutorials/robot-browser:latest' |
29 | | - args '--entrypoint=""' |
30 | | - reuseNode true |
31 | | - } } |
32 | | - steps { |
33 | | - sh "robot -d robot_output -l none -r none -o b.xml -N Firefox -v URL:${params.URL} --nostatusrc $d/suites/" |
34 | | - // If reuseNode true was not used, we would have to stash the output XML. |
35 | | - // stash includes: 'robot_output/**', name: 'Firefox' |
36 | | - } |
37 | | - } |
38 | | - } |
| 4 | + agent any |
| 5 | + parameters { |
| 6 | + string( |
| 7 | + name: 'URL', |
| 8 | + defaultValue: '', |
| 9 | + description: 'Target URL for the Robot Framework tasks') |
| 10 | + } |
| 11 | + stages { |
| 12 | + stage('Run tasks') { |
| 13 | + parallel { |
| 14 | + stage('Chromium') { |
| 15 | + agent { docker { |
| 16 | + image 'ghcr.io/cicd-tutorials/robot-browser:latest' |
| 17 | + args '--entrypoint=""' |
| 18 | + reuseNode true |
| 19 | + } } |
| 20 | + steps { |
| 21 | + sh "robot -d robot_output -l none -r none -o chromium.xml -N Chromium -v URL:${params.URL} --nostatusrc $d/suites/" |
| 22 | + // If reuseNode true was not used, we would have to stash the output XML. |
| 23 | + // stash includes: 'robot_output/**', name: 'Chromium' |
| 24 | + } |
39 | 25 | } |
40 | | - stage('Process logs') { |
41 | | - agent { docker { |
42 | | - image 'ghcr.io/cicd-tutorials/robot-browser:latest' |
43 | | - args '--entrypoint=""' |
44 | | - reuseNode true |
45 | | - } } |
46 | | - steps { |
47 | | - // If reuseNode true was not used, we would have to unstash the output XMLs. |
48 | | - // unstash 'Chromium' |
49 | | - // unstash 'Firefox' |
50 | | - sh "rebot -d rebot_output -o output.xml -N '${env.JOB_BASE_NAME} ${BUILD_DISPLAY_NAME}' --nostatusrc robot_output/*.xml" |
51 | | - } |
| 26 | + stage('Firefox') { |
| 27 | + agent { docker { |
| 28 | + image 'ghcr.io/cicd-tutorials/robot-browser:latest' |
| 29 | + args '--entrypoint=""' |
| 30 | + reuseNode true |
| 31 | + } } |
| 32 | + steps { |
| 33 | + sh "robot -d robot_output -l none -r none -o b.xml -N Firefox -v URL:${params.URL} --nostatusrc $d/suites/" |
| 34 | + // If reuseNode true was not used, we would have to stash the output XML. |
| 35 | + // stash includes: 'robot_output/**', name: 'Firefox' |
| 36 | + } |
52 | 37 | } |
| 38 | + } |
53 | 39 | } |
54 | | - post { |
55 | | - success { |
56 | | - robot outputPath: 'rebot_output', otherFiles: '**/*.png', onlyCritical: false, passThreshold: 100.0, unstableThreshold: 0.0 |
57 | | - } |
| 40 | + stage('Process logs') { |
| 41 | + agent { docker { |
| 42 | + image 'ghcr.io/cicd-tutorials/robot-browser:latest' |
| 43 | + args '--entrypoint=""' |
| 44 | + reuseNode true |
| 45 | + } } |
| 46 | + steps { |
| 47 | + // If reuseNode true was not used, we would have to unstash the output XMLs. |
| 48 | + // unstash 'Chromium' |
| 49 | + // unstash 'Firefox' |
| 50 | + sh "rebot -d rebot_output -o output.xml -N '${env.JOB_BASE_NAME} ${BUILD_DISPLAY_NAME}' --nostatusrc robot_output/*.xml" |
| 51 | + } |
| 52 | + } |
| 53 | + } |
| 54 | + post { |
| 55 | + success { |
| 56 | + robot outputPath: 'rebot_output', otherFiles: '**/*.png', onlyCritical: false, passThreshold: 100.0, unstableThreshold: 0.0 |
58 | 57 | } |
| 58 | + } |
59 | 59 | } |
0 commit comments