Create jenkinsfile

Create Sample Jenkins File
This commit is contained in:
sandeepds 2019-08-23 19:41:18 +05:30 committed by GitHub
parent adb702feb5
commit ef1fca9267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

25
jenkinsfile Normal file
View file

@ -0,0 +1,25 @@
node {
def mvnHome
stage('Preparation') { // for display purposes
// Get some code from a GitHub repository
git 'https://github.com/jglick/simple-maven-project-with-tests.git'
// Get the Maven tool.
// ** NOTE: This 'M3' Maven tool must be configured
// ** in the global configuration.
mvnHome = tool 'M3'
}
stage('Build') {
// Run the maven build
withEnv(["MVN_HOME=$mvnHome"]) {
if (isUnix()) {
sh '"$MVN_HOME/bin/mvn" -Dmaven.test.failure.ignore clean package'
} else {
bat(/"%MVN_HOME%\bin\mvn" -Dmaven.test.failure.ignore clean package/)
}
}
}
stage('Results') {
junit '**/target/surefire-reports/TEST-*.xml'
archiveArtifacts 'target/*.jar'
}
}