forked from brentlaster/filedump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
41 lines (38 loc) · 1.04 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!groovy
node ('worker_node1') {
// always run with a new workspace
step([$class: 'WsCleanup'])
try {
stage('Source') {
checkout scm
stash name: 'test-sources', includes: 'build.gradle,src/test/'
}
stage('Build') {
// Run the gradle build
sh 'gradle clean build'
}
stage ('Test') {
// execute required unit tests in parallel
parallel (
worker1: { node ('master'){
// always run with a new workspace
step([$class: 'WsCleanup'])
unstash 'test-sources'
sh 'gradle -D test.single=TestExample1 test'
}},
worker2: { node ('worker_node1'){
// always run with a new workspace
step([$class: 'WsCleanup'])
unstash 'test-sources'
sh 'gradle -D test.single=TestExample2 test'
}},
)
}
}
catch (err) {
echo "Caught: ${err}"
}
stage ('Notify') {
// mailUser('<your email address>', "Finished")
}
}