#!groovy
githubCredentials = 'github_credentials'
def projectBranch = "${env.BRANCH_NAME}"
node {
def javaHome = tool "java8" // ensure Java 8 is installed
def projectRepoURL = 'g...@github.com:tonymurphy/jenkins-test.git'
echo "${env.getEnvironment()}"
def mvnHome = tool "mvn-3.2.2"
wrap([$class: 'AnsiColorBuildWrapper', colorMapName: 'xterm']) {
stage "Checkout"
sh("git config --global credential.helper cache")
checkout([$class : 'GitSCM',
branches : [[name: projectBranch]],
extensions : [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'jenkins-test'], [$class: 'CheckoutOption', timeout: 100000]],
userRemoteConfigs: [[credentialsId: githubCredentials, url: projectRepoURL]]])
stage 'Build'
withEnv(["PATH+ACTIVATOR=${tool 'activator-1.3.x'}", "PATH+JDK=${javaHome}/bin", "JAVA_HOME=${javaHome}"]) {
dir("jenkins-test") {
sh "${mvnHome}/bin/mvn clean compile test "
step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true])
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
}
}
}
}Thanks!
Not sure I get what your actual issue is. Could you maybe rephrase it to say what you see, compared to what you expect, and provide the error logs and so on?
Cheers
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAORQRkVZKg0fh4oqcgi8CQKhfpJ6BGnBoHijP55xv1SUR2VF6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
#!groovy
node {
def javaHome = tool "java8" // ensure Java 8 is installed
def projectRepoURL = 'g...@github.com:tonymurphy/jenkins-test.git'
echo "${env.getEnvironment()}"
def mvnHome = tool "mvn-3.2.2"
wrap([$class: 'AnsiColorBuildWrapper', colorMapName: 'xterm']) {
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
Step 5, you say you added a checkout step, but can't see it. Why didn't you leave it? It's indeed required to have the sources.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d8ea5e81-5de8-4eac-b23b-94213f55e057%40googlegroups.com.