Skip to content

Instantly share code, notes, and snippets.

@jbleduigou
Created February 5, 2020 20:17
Show Gist options
  • Save jbleduigou/13ec96c7cbb93a6be08a37908ce3778d to your computer and use it in GitHub Desktop.
Save jbleduigou/13ec96c7cbb93a6be08a37908ce3778d to your computer and use it in GitHub Desktop.
boucles.groovy
#!/usr/bin/groovy
pipeline {
agent any
tools {
// Install the Maven version configured as "M3" and add it to the path.
maven "M3"
}
stages {
stage('Build') {
steps {
// Get the code from GitHub repository
git 'https://github.com/jbleduigou/boucles.git'
// Run Maven on the amazon linux agent.
sh "mvn clean package"
}
post {
// If Maven was able to run the tests, even if some of the test
// failed, record the test results and archive the jar file.
success {
junit '**/target/surefire-reports/TEST-*.xml'
archiveArtifacts 'target/boucles*.jar'
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment