@@ -693,6 +693,7 @@ private HtmlPage submitConfigureForm(
693693 */
694694 private static void gitCloneBuildMonitoringExporter () throws Exception {
695695 String monitoringExporterSrcDir = monitoringExporterDir + "/src" ;
696+ // target dir for monitoring exporter webapp
696697 String monitoringExporterWar =
697698 monitoringExporterDir + "/apps/monitoringexporter/wls-exporter.war" ;
698699 if (new File (monitoringExporterWar ).exists ()) {
@@ -701,6 +702,8 @@ private static void gitCloneBuildMonitoringExporter() throws Exception {
701702 if (!new File (monitoringExporterDir ).exists ()) {
702703 Files .createDirectories (Paths .get (monitoringExporterDir ));
703704 }
705+ // make sure to always refresh the code from github, if destination dir is not empty, clean it
706+ // first, clone after
704707 if (!monitoringExporterSrcDir .isEmpty ()) {
705708 StringBuffer removeAndClone = new StringBuffer ();
706709 logger .info (
@@ -718,13 +721,16 @@ private static void gitCloneBuildMonitoringExporter() throws Exception {
718721 .append (monitoringExporterSrcDir );
719722 TestUtils .exec (removeAndClone .toString ());
720723 }
724+
725+ // build monitoring exporter project
721726 StringBuffer buildExporter = new StringBuffer ();
722727 buildExporter
723728 .append ("cd " + monitoringExporterSrcDir )
724729 .append (" && " )
725730 .append (" mvn clean install --log-file output.txt" );
726731 TestUtils .exec (buildExporter .toString ());
727732
733+ // build monitoring monitoring exporter webapp
728734 StringBuffer buildExporterWAR = new StringBuffer ();
729735 buildExporterWAR
730736 .append ("cd " + monitoringExporterSrcDir + "/webapp" )
@@ -734,13 +740,15 @@ private static void gitCloneBuildMonitoringExporter() throws Exception {
734740 .append (" --log-file output1.txt" );
735741 TestUtils .exec (buildExporterWAR .toString ());
736742
743+ // build coordinator image
737744 StringBuffer buildCoordinatorImage = new StringBuffer ();
738745 buildCoordinatorImage
739746 .append ("cd " + monitoringExporterSrcDir + "/config_coordinator" )
740747 .append (" && " )
741748 .append (" docker build -t config_coordinator . " );
742749 TestUtils .exec (buildCoordinatorImage .toString ());
743750
751+ // copy created war file to desired destination
744752 buildExporterWAR = new StringBuffer ();
745753 buildExporterWAR
746754 .append (" mkdir " + monitoringExporterDir + "/apps" )
0 commit comments