diff --git a/jenkins/ci-pipelines/ci_helper.groovy b/jenkins/ci-pipelines/ci_helper.groovy index 21a8373f2f0961b41e87861bbeb2e18f5e1d8d4c..d058099c093612bd1d9299eba209bfca8f16916e 100644 --- a/jenkins/ci-pipelines/ci_helper.groovy +++ b/jenkins/ci-pipelines/ci_helper.groovy @@ -91,6 +91,12 @@ def archive(artifactory_server,mdg,branch,status) { def repo_prefix = 'osm-' def uploadSpec = """{ "files": [ + { + "pattern": "changelog/*", + "target": "${repo_prefix}${mdg}/${branch}/${BUILD_NUMBER}/", + "props": "${properties}", + "flat": false + }, { "pattern": "dists/*.gz", "target": "${repo_prefix}${mdg}/${branch}/${BUILD_NUMBER}/", diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy index 76201111402b84211127573e5552152446b9923c..aa4a9f4b67a0b4f6efc808ed8d3fd6195c601037 100644 --- a/jenkins/ci-pipelines/ci_stage_2.groovy +++ b/jenkins/ci-pipelines/ci_stage_2.groovy @@ -62,6 +62,8 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifa } stage('Archive') { + sh "mkdir changelog" + sh "devops/tools/generatechangelog-pipeline.sh > changelog/changelog-${mdg}.html" sh(returnStdout:true, script: 'devops-stages/stage-archive.sh').trim() ci_helper.archive(artifactory_server,mdg,branch,'untested') } diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index 9ea2d7f23a5f7bc3927cf0204abe71d7a5a161dc..6cb706d321c9bda56106b016ad3adaba20dfcc40 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -129,6 +129,12 @@ node("${params.NODE}") { // copy the public key into the release folder // this pulls the key from the home dir of the current user (jenkins) sh "cp ~/${REPO_KEY_NAME} ." + + // merge the change logs + sh """ + rm -f changelog/osm-changelog.html + [ -d changelog ] && for mdgchange in \$(ls changelog); do cat changelog/\$mdgchange >> changelog/osm-changelog.html; done + """ } // start an apache server to serve up the images http_server_name = "${container_name}-apache" diff --git a/tools/gen-repo.sh b/tools/gen-repo.sh index 502b941fbba0f8d422bf8b6e34c54ef1dcf4df7c..b1e768f4bc798cdc34fbb3bd43530a87b0c5cb9e 100755 --- a/tools/gen-repo.sh +++ b/tools/gen-repo.sh @@ -113,6 +113,7 @@ mkdir -p $BASE_DIR/dists cp -R $BUILD_NUMBER/dists/$IN_REPO $BASE_DIR/dists/$OUT_REPO cp -R $BUILD_NUMBER/pool $BASE_DIR/ +[ -d "$BUILD_NUMBER/changelog" ] && cp -R $BUILD_NUMBER/changelog $BASE_DIR/ cd $BASE_DIR diff --git a/tools/generatechangelog-pipeline.sh b/tools/generatechangelog-pipeline.sh new file mode 100755 index 0000000000000000000000000000000000000000..83a767a74222d1282fdd50da338ac559b3267756 --- /dev/null +++ b/tools/generatechangelog-pipeline.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +REPO_NAME=$(basename $(git config --get remote.origin.url) | cut -d'.' -f1) +# get the latest tag +TAG_END="HEAD" +TAG_START=$(git tag | sort -Vr | head -1) +git pull --tags origin master &> /dev/null +echo "