forked from wajda/lz-string4java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
45 lines (42 loc) · 1.09 KB
/
Jenkinsfile
File metadata and controls
45 lines (42 loc) · 1.09 KB
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
41
42
43
44
45
#!/usr/bin/env groovy
import com.vidal.jenkins.*
pipeline {
agent {
docker {
image 'ci/mvn-chrome:2.0.0'
args "--volume /data/repository:/tmp/mvn-repo --name=lz-string4java-${BRANCH_NAME}-${env.BUILD_ID} -v /var/run/docker.sock:/var/run/docker.sock --group-add docker-slave"
}
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
}
stages {
stage('Prepare') {
when {
expression { Branches.isPullRequest(BRANCH_NAME) }
}
steps {
cancelPreviousBuild()
}
}
stage('Build and Tests') {
steps {
mvn 'clean verify'
junit '**/target/surefire-reports/TEST-*.xml'
}
}
stage('Share (Nexus)') {
when {
anyOf {
branch 'master'
branch 'sprint-*'
}
expression { currentBuild.resultIsBetterOrEqualTo('SUCCESS') }
}
steps {
mvn 'deploy -DskipTests'
}
}
}
}