build/archive changelog for mdg

Change-Id: Ia4f0a11579cd88e53477e7c9047739abc9744bf9
Signed-off-by: Mike Marchetti <mmarchetti@sandvine.com>
diff --git a/jenkins/ci-pipelines/ci_helper.groovy b/jenkins/ci-pipelines/ci_helper.groovy
index 21a8373..d058099 100644
--- a/jenkins/ci-pipelines/ci_helper.groovy
+++ b/jenkins/ci-pipelines/ci_helper.groovy
@@ -92,6 +92,12 @@
     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}/",
           "props": "${properties}",
diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy
index 7620111..aa4a9f4 100644
--- a/jenkins/ci-pipelines/ci_stage_2.groovy
+++ b/jenkins/ci-pipelines/ci_stage_2.groovy
@@ -62,6 +62,8 @@
     }
 
     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 9ea2d7f..6cb706d 100644
--- a/jenkins/ci-pipelines/ci_stage_3.groovy
+++ b/jenkins/ci-pipelines/ci_stage_3.groovy
@@ -129,6 +129,12 @@
                 // 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"