-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tighten up the Jenkinsfile for ci.j.io
- Loading branch information
R. Tyler Croy
committed
Sep 7, 2016
1 parent
6b54488
commit e581edf
Showing
1 changed file
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,25 @@ | ||
node { | ||
#!/usr/bin/env groovy | ||
|
||
node('docker') { | ||
/* clean out the workspace just to be safe */ | ||
deleteDir() | ||
|
||
/* Grab our source for this build */ | ||
checkout scm | ||
sh 'mvn clean install' | ||
|
||
stage 'Build' | ||
/* Performing some clever trickery to map our ~/.m2 into the container */ | ||
String containerArgs = '-v $HOME/.m2:/var/maven/.m2' | ||
/* Make sure our directory is there, if Docker creates it, it gets owned by 'root' */ | ||
sh 'mkdir -p $HOME/.m2' | ||
|
||
docker.image('maven:3.3.9-jdk-7').inside(containerArgs) { | ||
timestamps { | ||
sh 'mvn -B -U -e -Dmaven.test.failure.ignore=true -Duser.home=/var/maven clean install' | ||
} | ||
} | ||
|
||
stage 'Archive' | ||
junit 'target/surefire-reports/**/*.xml' | ||
archiveArtifacts artifacts: 'target/**/*.jar', fingerprint: true | ||
} |