Last active
February 12, 2020 20:11
-
-
Save jbleduigou/b0e4a9ad180045a93a52b36308046e7a to your computer and use it in GitHub Desktop.
boucles-owasp.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' | |
sh 'git reset --hard b4c1728fe143548a6c72f6084eb20c1fe67a98cf' | |
// 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' | |
} | |
} | |
} | |
stage('Vulnerabilities') { | |
steps { | |
// Check project dependencies to see if they have any known published vulnerabilities. | |
sh "mvn org.owasp:dependency-check-maven:aggregate -Dformat=xml" | |
} | |
post { | |
success { | |
// Publish dependency check results and update build status accordingly | |
step([$class: 'DependencyCheckPublisher', unstableTotalHigh: 1]) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment