Skip to content

Commit

Permalink
Tighten up the Jenkinsfile for ci.j.io
Browse files Browse the repository at this point in the history
  • 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.
25 changes: 23 additions & 2 deletions Jenkinsfile
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
}

0 comments on commit e581edf

Please sign in to comment.