forked from pndaproject/platform-deployment-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
39 lines (30 loc) · 1.08 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
node {
try {
stage 'Build'
def workspace = pwd()
def version = env.BRANCH_NAME
checkout scm
if(env.BRANCH_NAME=="master") {
version = sh(returnStdout: true, script: 'git describe --abbrev=0 --tags').trim()
checkout([$class: 'GitSCM', branches: [[name: "tags/${version}"]], extensions: [[$class: 'CleanCheckout']]])
}
sh """
cd api
mvn versions:set -DnewVersion=${version}
mvn clean package
"""
stage 'Test'
sh '''
cd api/src/main/resources
pylint_wrapper.py 10
nosetests test_*.py
'''
stage 'Deploy'
emailext attachLog: true, body: "Build succeeded (see ${env.BUILD_URL})", subject: "[JENKINS] ${env.JOB_NAME} succeeded", to: "[email protected]"
}
catch(error) {
emailext attachLog: true, body: "Build failed (see ${env.BUILD_URL})", subject: "[JENKINS] ${env.JOB_NAME} failed", to: "[email protected]"
currentBuild.result = "FAILED"
throw error
}
}