Skip to content

Commit 35fe0f7

Browse files
authored
Merge pull request #5 from pndaproject/RELEASE-0.1.1
Refine master branch build to use release tags
2 parents bac7d5a + 7856f31 commit 35fe0f7

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

CHANGELOG renamed to CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [0.1.1] 2016-09-13
5+
### Changes
6+
- Improvements to documentation
7+
- Enhanced CI support
8+
49
## [0.1.0] 2016-07-01
510
### First version
611

Jenkinsfile

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
11
node {
22
try {
33
stage 'Build'
4+
5+
deleteDir()
6+
7+
checkout scm
8+
49
def workspace = pwd()
10+
def version = env.BRANCH_NAME
511

6-
sh '''
7-
echo $PWD
8-
echo $BRANCH_NAME
9-
cd $PWD@script/api;mvn versions:set -DnewVersion=$BRANCH_NAME
10-
mvn clean package
11-
'''
12+
if(env.BRANCH_NAME=="master") {
13+
version = sh(returnStdout: true, script: 'git describe --abbrev=0 --tags').trim()
14+
checkout([$class: 'GitSCM', branches: [[name: "tags/${version}"]], extensions: [[$class: 'CleanCheckout']]])
15+
}
16+
17+
sh """
18+
cd api
19+
mvn versions:set -DnewVersion=${version}
20+
mvn clean package
21+
"""
1222

1323
stage 'Test'
1424
sh '''
15-
cd $PWD@script/api/src/main/resources/;
25+
cd api/src/main/resources
1626
pylint_wrapper.py 10
1727
nosetests test_*.py
1828
'''
1929

2030
stage 'Deploy'
21-
build job: 'deploy-component', parameters: [[$class: 'StringParameterValue', name: 'branch', value: env.BRANCH_NAME],[$class: 'StringParameterValue', name: 'component', value: "deployment-manager"],[$class: 'StringParameterValue', name: 'release_path', value: "platform/releases"],[$class: 'StringParameterValue', name: 'release', value: "${workspace}@script/api/target/deployment-manager-${env.BRANCH_NAME}.tar.gz"]]
31+
build job: 'deploy-component', parameters: [[$class: 'StringParameterValue', name: 'branch', value: env.BRANCH_NAME],[$class: 'StringParameterValue', name: 'component', value: "deployment-manager"],[$class: 'StringParameterValue', name: 'release_path', value: "platform/releases"],[$class: 'StringParameterValue', name: 'release', value: "${workspace}/api/target/deployment-manager-${version}.tar.gz"]]
2232

2333
emailext attachLog: true, body: "Build succeeded (see ${env.BUILD_URL})", subject: "[JENKINS] ${env.JOB_NAME} succeeded", to: "${env.EMAIL_RECIPIENTS}"
2434

0 commit comments

Comments
 (0)