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}/",
}
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')
}
// 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"
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
--- /dev/null
+#!/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 "<h1>$REPO_NAME Changelog</h1>"
+echo "<h2>tag: ${TAG_START} -> ${TAG_END}</h2>"
+git log --pretty=format:"<li> <a href=https://osm.etsi.org/gitweb/?p=osm/$i.git;a=commitdiff;h=%H>%h •</a> %s</li> " --reverse ${TAG_START}..${TAG_END}
exit 1
fi
+TEMPDIR=$(mktemp -d)
+
echo "<h1>OSM Changelog</h1>" >> $OUTFILE
for i in $list; do
+ REPODIR=$TEMPDIR/$i
echo
echo $i
- if [ ! -d $i ]; then
- git clone https://osm.etsi.org/gerrit/osm/$i
+ if [ ! -d $REPODIR ]; then
+ git clone https://osm.etsi.org/gerrit/osm/$i $REPODIR
fi
- git -C $i checkout master
- git -C $i pull --rebase
- git -C $i fetch --tags
- TAG_START=$(git -C $i tag | sort -Vr | head -2 | sort -V | head -1)
- TAG_END=$(git -C $i tag | sort -Vr | head -1)
+ git -C $REPODIR checkout master
+ git -C $REPODIR pull --rebase
+ git -C $REPODIR fetch --tags
+ TAG_START=$(git -C $REPODIR tag | sort -Vr | head -2 | sort -V | head -1)
+ TAG_END=$(git -C $REPODIR tag | sort -Vr | head -1)
echo "<h2>Changes for $i tag: ${TAG_START}..${TAG_END}</h2>" >> $OUTFILE
#git -C $i log --pretty=format:"* %h; author: %cn; date: %ci; subject:%s" ${TAG_START}..${TAG_END} >> $OUTFILE
- git -C $i log --pretty=format:"<li> <a href=https://osm.etsi.org/gitweb/?p=osm/$i.git;a=commitdiff;h=%H>%h •</a> %s</li> " --reverse ${TAG_START}..${TAG_END} >> $OUTFILE
+ git -C $REPODIR log --pretty=format:"<li> <a href=https://osm.etsi.org/gitweb/?p=osm/$i.git;a=commitdiff;h=%H>%h •</a> %s</li> " --reverse ${TAG_START}..${TAG_END} >> $OUTFILE
echo "" >> $OUTFILE
done