File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change 11pipeline {
2- agent none // we will assign agents per stage
2+ agent none // assign agents per stage
33 tools {
4- maven " MAVEN" // Must match your Maven installation name in Jenkins
4+ maven " MAVEN" // must match Maven tool name in Jenkins
55 }
66 stages {
77 stage(" Build" ) {
8- agent { label ' Master' } // build on master
8+ agent { label ' Master' } // build on Windows master
99 steps {
1010 bat " mvn clean package"
1111 }
1212 }
1313 stage(" Run on Slaves" ) {
14- parallel(
15- slave1Job : {
16- agent { label ' slave1' }
14+ parallel {
15+ stage( " Run on Slave1 " ) {
16+ agent { label ' slave1' } // Linux slave
1717 steps {
1818 echo " Running on slave1"
19- bat " java -cp target\\ my-app-1.0-SNAPSHOT.jar com.mycompany.app.App"
19+ sh " java -cp target/ my-app-1.0-SNAPSHOT.jar com.mycompany.app.App"
2020 }
21- },
22- slave2Job : {
23- agent { label ' slave2' }
21+ }
22+ stage( " Run on Slave2 " ) {
23+ agent { label ' slave2' } // Linux slave
2424 steps {
2525 echo " Running on slave2"
26- bat " java -cp target\\ my-app-1.0-SNAPSHOT.jar com.mycompany.app.App"
26+ sh " java -cp target/ my-app-1.0-SNAPSHOT.jar com.mycompany.app.App"
2727 }
2828 }
29- )
29+ }
3030 }
3131 }
3232 post {
3333 success {
34- archiveArtifacts artifacts : " **\\ target\\ *.jar"
34+ archiveArtifacts artifacts : " **/ target/ *.jar"
3535 }
3636 }
3737}
You can’t perform that action at this time.
0 commit comments