Skip to content

Commit abdb7a2

Browse files
author
Zhao Xiaojie
authored
Update Jenkinsfile
1 parent b6df4ad commit abdb7a2

1 file changed

Lines changed: 18 additions & 11 deletions

File tree

Jenkinsfile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
pipeline {
2-
agent any
2+
agent {
3+
label 'java'
4+
}
35

46
options {
5-
disableConcurrentBuilds()
6-
}
7+
disableConcurrentBuilds()
8+
}
79

810

911
stages{
10-
stage('one'){
12+
stage('Build & Test'){
1113
steps{
12-
echo 'sdf'
13-
sleep 10
14+
try {
15+
container('java'){
16+
sh 'mvn clean package test'
17+
}
18+
} catch(e) {
19+
sh 'mvn clean package test'
20+
}
1421
}
1522
}
1623

17-
stage('two'){
24+
stage('Only for demo'){
1825
when {
19-
allOf {
20-
branch 'master'
21-
}
22-
}
26+
allOf {
27+
branch 'master'
28+
}
29+
}
2330
steps{
2431
echo 'sf'
2532
}

0 commit comments

Comments
 (0)