Skip to content

Instantly share code, notes, and snippets.

@twasink
Last active August 1, 2016 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twasink/272d2f7b439793a7adfeaa4b73aa3dd7 to your computer and use it in GitHub Desktop.
Save twasink/272d2f7b439793a7adfeaa4b73aa3dd7 to your computer and use it in GitHub Desktop.
#!groovy
node {
// Need to replace the '%2F' used by Jenkins to deal with / in the path (e.g. story/...)
// because tests that do getResource will escape the % again, and the test files can't be found.
// See https://issues.jenkins-ci.org/browse/JENKINS-34564 for more.
ws("workspace/${env.JOB_NAME}/${env.BRANCH_NAME}".replace('%2F', '_')) {
// Mark the code checkout 'stage'....
stage 'Checkout'
checkout scm
// Mark the code build 'stage'....
stage 'Build'
def mvnHome = tool 'maven-3.3.9'
sh "${mvnHome}/bin/mvn clean verify -B"
junit testResults: '**/surefire-reports/*.xml'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment