File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
pipeline-examples/external-workspace-manager Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ # Synopsis
2+ Shows how to allocate the same workspace on multiple nodes using the
3+ [ External Workspace Manager Plugin] ( https://github.com/jenkinsci/external-workspace-manager-plugin ) .
4+
5+ # Prerequisites
6+ Before using this script, you must configure several prerequisites.
7+ A starting guide may be found in the
8+ [ prerequisites] ( https://github.com/jenkinsci/external-workspace-manager-plugin/blob/master/doc/PREREQUISITES.md )
9+ section, from the plugin's documentation.
10+
11+ # Documentation
12+ Additional examples can be found on the plugin's
13+ [ documentation page] ( https://github.com/jenkinsci/external-workspace-manager-plugin/blob/master/README.md ) ,
14+ along with all the available features.
Original file line number Diff line number Diff line change 1+ // allocate a Disk from the Disk Pool defined in the Jenkins global config
2+ def extWorkspace = exwsAllocate ' diskpool1'
3+
4+ // on a node labeled 'linux', perform code checkout and build the project
5+ node(' linux' ) {
6+ // compute complete workspace path, from current node to the allocated disk
7+ exws(extWorkspace) {
8+ // checkout code from repo
9+ checkout scm
10+ // build project, but skip running tests
11+ sh ' mvn clean install -DskipTests'
12+ }
13+ }
14+
15+ // on a different node, labeled 'test', perform testing using the same workspace as previously
16+ node(' test' ) {
17+ // compute complete workspace path, from current node to the allocated disk
18+ exws(extWorkspace) {
19+ // run tests in the same workspace that the project was built
20+ sh ' mvn test'
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments