diff options
| -rw-r--r-- | Jenkinsfile | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 655deb3f..abc157cd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile | |||
| @@ -1,15 +1,26 @@ | |||
| 1 | node { | 1 | pipeline { |
| 2 | stage 'Checkout' | 2 | agent any |
| 3 | stages { | ||
| 3 | 4 | ||
| 4 | checkout scm | 5 | stage ('Build') { |
| 6 | steps { | ||
| 7 | sh "rm -rf build/libs/" | ||
| 8 | sh "chmod +x gradlew" | ||
| 9 | sh "./gradlew build" | ||
| 5 | 10 | ||
| 6 | stage 'Build' | 11 | archiveArtifacts artifacts: '**/build/libs/*.jar', fingerprint: true |
| 12 | } | ||
| 13 | } | ||
| 7 | 14 | ||
| 8 | sh "rm -rf build/libs/" | 15 | stage ('Archive artifacts') { |
| 9 | sh "chmod +x gradlew" | 16 | //Only publish to maven when on master branch |
| 10 | sh "./gradlew build" | 17 | when { |
| 18 | branch 'master' | ||
| 19 | } | ||
| 20 | steps { | ||
| 21 | sh "./gradlew upload" | ||
| 22 | } | ||
| 23 | } | ||
| 11 | 24 | ||
| 12 | stage "Archive artifacts" | 25 | } |
| 13 | 26 | } \ No newline at end of file | |
| 14 | sh "./gradlew upload" | ||
| 15 | } | ||