Skip to content

Instantly share code, notes, and snippets.

@arehmandev
Forked from chinshr/Jenkinsfile
Created April 12, 2017 10:10
Show Gist options
  • Select an option

  • Save arehmandev/d74165760b6bc08fbb6547ee6260f7d8 to your computer and use it in GitHub Desktop.

Select an option

Save arehmandev/d74165760b6bc08fbb6547ee6260f7d8 to your computer and use it in GitHub Desktop.
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
# Jenkinsfile
# Build and test a Maven project
node {
git url: 'https://github.com/user/repo.git'
def mvnHome = tool 'M3'
sh "${mvnHome}/bin/mvn -B -Dmaven.test.failure.ignore verify"
step([$class: 'JUnitResultArchiver', testResults:
'**/target/foobar/TEST-*.xml'])
}
# Jenkinsfile
# Verify a Maven project
node {
git url: 'https://github.com/user/repo.git'
def mvnHome = tool 'M3'
sh "${mvnHome}/bin/mvn -B verify"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment