Skip to content

Commit

Permalink
Use readMavenPom
Browse files Browse the repository at this point in the history
  • Loading branch information
definite committed Dec 11, 2017
1 parent ccc5fdd commit 61ef028
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions jenkins/maven-Jenkinsfile
Expand Up @@ -60,7 +60,7 @@ def jobName
timestamps {
// We need a node with release label
node('release') {
ansiColor('xterm') {
ansicolor {
pipelineLibraryScmGit = new ScmGit(env, steps, 'https://github.com/zanata/zanata-pipeline-library')
pipelineLibraryScmGit.init(PIPELINE_LIBRARY_BRANCH)
mainScmGit = new ScmGit(env, steps, PROJ_URL)
Expand Down Expand Up @@ -111,13 +111,14 @@ timestamps {
// Note that this checkout zanata-scripts
checkout scm

sh "bash -x $WORKSPACE/zanata-functions run print_status 'Ensure the repo $REPO_NAME is at $WORK_ROOT'"
sh "bash -x $WORKSPACE/zanata-functions run ensure_repo $REPO_NAME"
sh "bash -x $WORKSPACE/zanata-functions run checkout_branch $REPO_NAME release $WORK_ROOT"
sh "bash $WORKSPACE/zanata-functions run print_status 'Ensure the repo $REPO_NAME is at $WORK_ROOT'"
sh "bash $WORKSPACE/zanata-functions run ensure_repo $REPO_NAME"
sh "bash $WORKSPACE/zanata-functions run checkout_branch $REPO_NAME release $WORK_ROOT"
if (params.RELEASE_VERSION == 'auto') {
releaseVersion = sh(returnStdout: true,
script: "sed -r -n -e 's|^.*<version>([0-9.]*)(-SNAPSHOT)?</version>.*\$|\\1|p' ${WORK_ROOT}/${REPO_NAME}/pom.xml",
)
releaseVersion = readMavenPom(file: "${WORK_ROOT}/${REPO_NAME}/pom.xml").getVersion()
// releaseVersion = sh(returnStdout: true,
// script: "sed -r -n -e 's|^.*<version>([0-9.]*)(-SNAPSHOT)?</version>.*\$|\\1|p' ${WORK_ROOT}/${REPO_NAME}/pom.xml",
// )
}
echo "Release Version: $releaseVersion"
sh "echo 'test stderr' > /dev/stderr"
Expand All @@ -129,7 +130,7 @@ timestamps {
String releaseNoteVersion = releaseVersion.replaceAll('-.*','')
echo "releaseNoteVersion: $releaseNoteVersion"
def releaseNoteStatus = sh(returnStatus: true,
script: "bash -x $WORKSPACE/zanata-release-notes-prepend -j $ARTIFACT_ID $releaseNoteVersion",
script: "bash $WORKSPACE/zanata-release-notes-prepend -j $ARTIFACT_ID $releaseNoteVersion",
)
echo "releaseNoteStatus: $releaseNoteVersion"
switch(releaseNoteStatus){
Expand Down

0 comments on commit 61ef028

Please sign in to comment.