File tree Expand file tree Collapse file tree 1 file changed +15
-20
lines changed
Expand file tree Collapse file tree 1 file changed +15
-20
lines changed Original file line number Diff line number Diff line change @@ -2,27 +2,22 @@ pipeline {
22 agent none
33
44 stages {
5- stage(' Build' ) {
6- agent { label ' built-in' }
7- tools { maven ' MAVEN' }
8- steps {
9- bat ' mvn clean install -DskipTests'
10- archiveArtifacts artifacts : ' target/my-app-1.0-SNAPSHOT.jar' , fingerprint : true
11- }
12- }
5+ stage(' Build' ) {
6+ agent { label ' built-in' }
7+ tools { maven ' MAVEN' }
8+ steps {
9+ bat ' mvn clean install -DskipTests'
10+ stash includes : ' target/my-app-1.0-SNAPSHOT.jar' , name : ' app-jar '
11+ }
12+ }
1313
14+ stage(' Run on Slave' ) {
15+ agent { label ' docker' }
16+ steps {
17+ unstash ' app-jar'
18+ sh ' java -jar my-app-1.0-SNAPSHOT.jar'
19+ }
20+ }
1421
15- stage(' Run on Slave' ) {
16- agent { label ' docker' }
17- steps {
18- // Use unarchive instead of copyArtifacts
19- copyArtifacts(
20- projectName : " ${ env.JOB_NAME} " ,
21- filter : ' target/my-app-1.0-SNAPSHOT.jar' ,
22- selector : specific(' ${BUILD_NUMBER}' )
23- )
24- sh ' java -jar my-app-1.0-SNAPSHOT.jar'
25- }
26- }
2722 }
2823}
You can’t perform that action at this time.
0 commit comments