Created
August 1, 2016 12:56
-
-
Save twasink/2e893dc50d20fac2a94661042da8aa2b to your computer and use it in GitHub Desktop.
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
#!groovy | |
node { | |
// Need to replace the '%2F' used by Jenkins to deal with / in the path (e.g. story/...) | |
// because tests that do getResource will escape the % again, and the test files can't be found | |
ws("workspace/${env.JOB_NAME}/${env.BRANCH_NAME}".replace('%2F', '_')) { | |
// Mark the code checkout 'stage'.... | |
stage 'Checkout' | |
checkout scm | |
// Mark the code build 'stage'.... | |
stage 'Build' | |
def mvnHome = tool 'maven-3.3.9' | |
sh "${mvnHome}/bin/mvn clean verify -B" | |
junit testResults: '**/surefire-reports/*.xml' | |
stage 'Publish' | |
step([$class: 'S3BucketPublisher', | |
dontWaitForConcurrentBuildCompletion: false, | |
entries: [[bucket: '${env.MY_S3_BUCKET}', | |
excludedFile: '', | |
flatten: false, | |
gzipFiles: false, | |
keepForever: false, | |
managedArtifacts: true, | |
noUploadOnFailure: true, | |
selectedRegion: 'us-east-1', | |
sourceFile: '**/target/*.war', | |
storageClass: 'STANDARD', | |
uploadFromSlave: true, | |
useServerSideEncryption: false | |
]], | |
profileName: 's3Artefacts']) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment