Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2018-12-20 09:10:28 -0500
committerSravan Kumar Lakkimsetti2018-12-20 09:15:03 -0500
commitb6da9a0f6996feb6e2a42a758b23f5aa7e46ca93 (patch)
treefdf9621e0c7da41cc8c210f7f1012ea79adcd461
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>
-rw-r--r--eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/staticDropFiles/gitLog.php58
-rw-r--r--eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/templateFiles/index.template_java12.php5
-rw-r--r--eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/templateFiles/index.template_master.php5
-rwxr-xr-xproduction/build-functions.shsource31
4 files changed, 80 insertions, 19 deletions
diff --git a/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/staticDropFiles/gitLog.php b/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/staticDropFiles/gitLog.php
new file mode 100644
index 00000000..b2678ca2
--- /dev/null
+++ b/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/staticDropFiles/gitLog.php
@@ -0,0 +1,58 @@
+<?php
+
+include_once("buildproperties.php");
+include_once("utilityFunctions.php");
+
+# Begin: page-specific settings.
+$pageTitle = "Git Log for $BUILD_ID";
+$pageKeywords = "eclipse,project,plug-ins,plugins,java,ide,swt,refactoring,free java ide,tools,platform,open source,development environment,development,ide";
+$pageAuthor = "Sravan Kumar Lakkimsetti";
+
+//ini_set("display_errors", "true");
+//error_reporting (E_ALL);
+
+
+ob_start();
+
+/*
+DL.thin.header.php.html was original obtained from
+
+wget https://eclipse.org/eclipse.org-common/themes/solstice/html_template/thin/header.php
+
+and then that file modified to suit our needs.
+Occasionally, our version should be compared to the "standard" to see if anything has
+changed, in the interest of staying consistent.
+
+See https://eclipse.org/eclipse.org-common/themes/solstice/docs/
+
+ */
+$endingBreadCrumbs="<li><a href=\"../$BUILD_DIR_SEG/\">$BUILD_ID</a></li><li class=\"active\">Git Log</li>";
+
+require("DL.thin.header.php.html");
+
+?>
+
+
+
+
+<?php
+
+echo "<h1>Git Log for <a href=\"../".$BUILD_DIR_SEG."\">".$BUILD_ID;
+echo "</a></h1>".PHP_EOL;
+echo "<div class=\"resultsSection\">";
+if (file_exists("gitLog.html")) {
+ $log_file = file_get_contents("gitLog.html");
+ echo "$log_file";
+}
+?>
+
+</div>
+</main>
+ </body>
+ </html>
+<?php
+ $html = ob_get_clean();
+
+ #echo the computed content
+ echo $html;
+?>
diff --git a/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/templateFiles/index.template_java12.php b/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/templateFiles/index.template_java12.php
index 3541c4f6..baf00248 100644
--- a/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/templateFiles/index.template_java12.php
+++ b/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/templateFiles/index.template_java12.php
@@ -138,7 +138,8 @@ if (isset ($BUILD_FAILED) ) {
$SPECIFIC_LOG=$MATCHES[3];
echo "<p>Specifically, see <a href=\"buildlogs/$SPECIFIC_LOG\">the log with errors</a>, \n";
echo "or a <a href=\"$summaryFile[0]\">summary</a>. <br /> \n";
- echo "Or see traditional <a href=\"testResults.php\">Compile Logs</a> (if any).</p>\n";
+ echo "Or see traditional <a href=\"testResults.php\">Compile Logs</a> (if any).\n";
+ echo "See recent changes in the <a href="gitLog.php">git log</a>.</p>\n";
}
}
@@ -318,7 +319,7 @@ else {
<ul class="midlist">
<li><a href="https://www.eclipse.org/eclipse/development/plans/eclipse_project_plan_<?php echo $STREAMMajor; ?>_<?php echo $STREAMMinor; ?>.xml#target_environments">Target Platforms and Environments</a></li>
<li><a href="directory.txt">View the Git repositories used for the current build.</a></li>
- <li><a href="gitLog.txt">Git log.</a></li>
+ <li><a href="gitLog.php">Git log.</a></li>
<li><a href="http://wiki.eclipse.org/Platform-releng/How_to_check_integrity_of_downloads">How to verify a download.</a></li>
</ul>
<?php
diff --git a/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/templateFiles/index.template_master.php b/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/templateFiles/index.template_master.php
index 3541c4f6..baf00248 100644
--- a/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/templateFiles/index.template_master.php
+++ b/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/templateFiles/index.template_master.php
@@ -138,7 +138,8 @@ if (isset ($BUILD_FAILED) ) {
$SPECIFIC_LOG=$MATCHES[3];
echo "<p>Specifically, see <a href=\"buildlogs/$SPECIFIC_LOG\">the log with errors</a>, \n";
echo "or a <a href=\"$summaryFile[0]\">summary</a>. <br /> \n";
- echo "Or see traditional <a href=\"testResults.php\">Compile Logs</a> (if any).</p>\n";
+ echo "Or see traditional <a href=\"testResults.php\">Compile Logs</a> (if any).\n";
+ echo "See recent changes in the <a href="gitLog.php">git log</a>.</p>\n";
}
}
@@ -318,7 +319,7 @@ else {
<ul class="midlist">
<li><a href="https://www.eclipse.org/eclipse/development/plans/eclipse_project_plan_<?php echo $STREAMMajor; ?>_<?php echo $STREAMMinor; ?>.xml#target_environments">Target Platforms and Environments</a></li>
<li><a href="directory.txt">View the Git repositories used for the current build.</a></li>
- <li><a href="gitLog.txt">Git log.</a></li>
+ <li><a href="gitLog.php">Git log.</a></li>
<li><a href="http://wiki.eclipse.org/Platform-releng/How_to_check_integrity_of_downloads">How to verify a download.</a></li>
</ul>
<?php
diff --git a/production/build-functions.shsource b/production/build-functions.shsource
index 98c8d59e..bf03c22d 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