-
-
Save awsvpc/c9db0441c4ddde788e1ad76545948dde to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| node("Agent001") { | |
| def server | |
| def buildInfo | |
| stage ('Checkout') { | |
| checkout scm | |
| } | |
| stage ('Artifactory configuration') { | |
| server = Artifactory.server "sprint0-artifactory" | |
| rtMaven = Artifactory.newMavenBuild() | |
| rtMaven.tool = "mvn" | |
| rtMaven.deployer releaseRepo: 'private-releases', snapshotRepo: 'private-snapshots', server: server | |
| buildInfo = Artifactory.newBuildInfo() | |
| } | |
| stage ("Build") { | |
| rtMaven.run pom: 'pom.xml', goals: 'clean install', buildInfo: buildInfo | |
| } | |
| stage ('Publish build info') { | |
| try { | |
| sh "ls **/target/surefire-reports/TEST-*.xml" | |
| step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml']) | |
| } catch (Exception ex) { | |
| echo "No tests to archive" | |
| } | |
| try { | |
| sh "ls target/surefire-reports/TEST-*.xml" | |
| step([$class: 'JUnitResultArchiver', testResults: 'target/surefire-reports/TEST-*.xml']) | |
| } catch (Exception ex) { | |
| echo "No tests to archive" | |
| } | |
| server.publishBuildInfo buildInfo | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment