Skip to content

Commit

Permalink
Issue #7 - initial Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
joakime committed Sep 29, 2016
1 parent af0a64e commit fb38fab
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
node {
// System Dependent Locations
def mvntool = tool name: 'maven3', type: 'hudson.tasks.Maven$MavenInstallation'
def jdktool = tool name: 'jdk8', type: 'hudson.model.JDK'

// Environment
List mvnEnv = ["PATH+MVN=${mvntool}/bin", "PATH+JDK=${jdktool}/bin", "JAVA_HOME=${jdktool}/", "MAVEN_HOME=${mvntool}"]
mvnEnv.add("MAVEN_OPTS=-Xms256m -Xmx1024m -Djava.awt.headless=true")

stage 'Checkout'

checkout scm

stage 'Build & Test'

timeout(60) {
withCredentials([[$class: 'FileBinding', credentialsId: 'gcloud-service-account', variable: 'GCLOUDAUTH']]) {
sh "gcloud auth activate-service-account --key-file $GCLOUDAUTH"
sh "gcloud config set project ${env.PROJECTID}"
}
withEnv(mvnEnv) {
sh "mvn -B clean install -Dmaven.test.failure.ignore=true"
// Report failures in the jenkins UI
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
}
}

}

0 comments on commit fb38fab

Please sign in to comment.