Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2018-12-20 14:10:28 +0000
committerSravan Kumar Lakkimsetti2018-12-20 14:15:03 +0000
commitb6da9a0f6996feb6e2a42a758b23f5aa7e46ca93 (patch)
treefdf9621e0c7da41cc8c210f7f1012ea79adcd461 /production/build-functions.shsource
parent797d8b2a2e47a7b65a16547180800b98303445d7 (diff)
downloadeclipse.platform.releng.aggregator-b6da9a0f6996feb6e2a42a758b23f5aa7e46ca93.tar.gz
eclipse.platform.releng.aggregator-b6da9a0f6996feb6e2a42a758b23f5aa7e46ca93.tar.xz
eclipse.platform.releng.aggregator-b6da9a0f6996feb6e2a42a758b23f5aa7e46ca93.zip
Bug 541598 - Generate gitLog as html report
Change-Id: I9fd3ba683f9dbf6dc0463204780f87818c99e979 Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
Diffstat (limited to 'production/build-functions.shsource')
-rwxr-xr-xproduction/build-functions.shsource31
1 files changed, 16 insertions, 15 deletions
diff --git a/production/build-functions.shsource b/production/build-functions.shsource
index 98c8d59ee..bf03c22d8 100755
--- a/production/build-functions.shsource
+++ b/production/build-functions.shsource
@@ -509,7 +509,7 @@ fn-tag-build-inputs ()
# == Step 1 of git logging.
# TODO: This may not work right if "streams/repositories.txt" contains tags.
- GITLOG_FILENAME=gitLog.txt
+ GITLOG_FILENAME=gitLog.html
GITLOG_FILE=${buildDirectory}/${GITLOG_FILENAME}
echo "Creating ${GITLOG_FILENAME}"
# we set REPORTDATE first thing, to get some idea of "time elapsed" since start of build.
@@ -555,21 +555,22 @@ fn-tag-build-inputs ()
# == Step 2 of Git logging.
if [[ -n "${lastTag}" ]]
then
- # TODO: other log options to consider? --pretty=oneline?
- echo -e "\n\tGit log from ${lastTag} (previous) to ${BUILD_ID} (current)\n" > ${GITLOG_FILE}
- # We include the "time of report" since this report might be included in a "build has started"
- # mail message, so it would be good to know if we are much delayed in getting that message out.
- echo -e "\tThe tagging, and this report, were done at about $REPORTTIMESTAMP\n\n" >> ${GITLOG_FILE}
- # This first one is for aggregator itself.
- echo "Repository eclipse.platform.releng.aggregator" >> ${GITLOG_FILE}
- echo;echo >> ${GITLOG_FILE}
- git log ${lastTag}..${BUILD_ID} >> ${GITLOG_FILE}
- echo >> ${GITLOG_FILE}
- echo >> ${GITLOG_FILE}
- # And now all submodules. Note we use --quiet specifically not to have the
- # "Entering <submodule>" messages printed.
TMP_GIT_LOG=${TMP_DIR}/gitlog.txt
- git submodule --quiet foreach "git log ${lastTag}..${BUILD_ID}>${TMP_GIT_LOG};FILESIZE=\$(stat -c%s ${TMP_GIT_LOG});if [ \$FILESIZE -ne 0 ]; then echo Repository: \$path;echo;cat ${TMP_GIT_LOG};echo;echo;fi" >> ${GITLOG_FILE}
+ echo -e "<h2>Git log from ${lastTag} (previous) to ${BUILD_ID} (current)</h2>" > ${GITLOG_FILE}
+ echo -e "<h2>The tagging, and this report, were done at about $REPORTTIMESTAMP</h2>" >> ${GITLOG_FILE}
+ git log ${lastTag}..${BUILD_ID} --format=format:"<tr><td class=\"cell\">%cd</td><td class=\"cell\"><a href=\"https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/commit/?id=%H\">%s</a></td><td class=\"cell\">%aN</td></tr>">> ${TMP_GIT_LOG}
+ FILESIZE1=$(stat -c%s ${TMP_GIT_LOG})
+ if [ $FILESIZE1 -eq 0 ]
+ then
+ echo "<h3>No code changes from last build</h3>"
+ else
+ echo "<table width=\"80%\"><tbody> <tr><th class=\"cell\" colspan=\"3\">Repository: eclipse.platform.releng.aggregator</th></tr>" >> ${GITLOG_FILE}
+ echo "<tr> <th class=\"cell\">Date</th> <th class=\"cell\">Summary</th> <th class=\"cell\">Author</th> </tr>" >> ${GITLOG_FILE}
+ cat ${TMP_GIT_LOG} >> ${GITLOG_FILE}
+ echo "</tbody></table><br><br>">> ${GITLOG_FILE}
+ echo >> ${GITLOG_FILE}
+ git submodule --quiet foreach "comp=\$(echo \$path|cut -d. -f2);git log ${lastTag}..${BUILD_ID} --format=format:\"<tr><td class=\\\"cell\\\">%cd</td><td class=\\\"cell\\\"><a href=\\\"https://git.eclipse.org/c/\$comp/\$path.git/commit/?id=%H\\\">%s</a></td><td class=\\\"cell\\\">%aN</td></tr>\">${TMP_GIT_LOG};FILESIZE=\$(stat -c%s ${TMP_GIT_LOG});if [ \$FILESIZE -ne 0 ]; then echo \"<table width=\\\"80%\\\"><tbody> <tr><th class=\\\"cell\\\" colspan=\\\"3\\\">Repository: \$path</th></tr>\";echo \"<tr> <th class=\\\"cell\\\">Date</th> <th class=\\\"cell\\\">Summary</th> <th class=\\\"cell\\\">Author</th> </tr>\";cat ${TMP_GIT_LOG};echo \"</tbody></table><br><br>\";echo;fi" >> ${GITLOG_FILE}
+ fi
else
echo -e "\n\tGit log not generated because a reasonable previous tag could not be found." > ${GITLOG_FILE}
fi

Back to the top