@@ -129,7 +129,7 @@ public static void staticUnPrepare() throws Exception {
129
129
*
130
130
* @throws Exception if could not run the command successfully to clone from github
131
131
*/
132
- private static void gitCloneBuildMonitoringExporter () throws Exception {
132
+ private static void gitCloneMonitoringExporter () throws Exception {
133
133
String monitoringExporterSrcDir = monitoringExporterDir + "/src" ;
134
134
// target dir for monitoring exporter webapp
135
135
String monitoringExporterWar =
@@ -159,46 +159,58 @@ private static void gitCloneBuildMonitoringExporter() throws Exception {
159
159
.append (monitoringExporterSrcDir );
160
160
TestUtils .exec (removeAndClone .toString ());
161
161
}
162
-
163
- // build monitoring exporter project
164
- StringBuffer buildExporter = new StringBuffer ();
165
- buildExporter
166
- .append ("cd " + monitoringExporterSrcDir )
167
- .append (" && " )
168
- .append (" mvn clean install --log-file output.txt" );
169
- TestUtils .exec (buildExporter .toString ());
170
-
171
- // build monitoring monitoring exporter webapp
172
- StringBuffer buildExporterWar = new StringBuffer ();
173
- buildExporterWar
174
- .append ("cd " + monitoringExporterSrcDir + "/webapp" )
175
- .append (" && " )
176
- .append ("mvn package -Dconfiguration=" )
177
- .append (resourceExporterDir + "/rest_webapp.yml" )
178
- .append (" --log-file output1.txt" );
179
- TestUtils .exec (buildExporterWar .toString ());
180
-
181
- // build coordinator image
182
- StringBuffer buildCoordinatorImage = new StringBuffer ();
183
- buildCoordinatorImage
184
- .append ("cd " + monitoringExporterSrcDir + "/config_coordinator" )
185
- .append (" && " )
186
- .append (" docker build -t config_coordinator . " );
187
- TestUtils .exec (buildCoordinatorImage .toString ());
188
-
189
- // copy created war file to desired destination
190
- buildExporterWar = new StringBuffer ();
191
- buildExporterWar
192
- .append (" mkdir " + monitoringExporterDir + "/apps" )
193
- .append (" && mkdir " + monitoringExporterDir + "/apps/monitoringexporter" )
194
- .append (" && " )
195
- .append (" cp " + monitoringExporterSrcDir )
196
- .append ("/webapp/target/wls-exporter.war " )
197
- .append (monitoringExporterWar );
198
- TestUtils .exec (buildExporterWar .toString ());
199
162
}
200
163
}
201
164
165
+ /**
166
+ * Build monitoring exporter app
167
+ *
168
+ * @throws Exception if could not run the command successfully to clone from github
169
+ */
170
+ private static void buildMonitoringExporter () throws Exception {
171
+ String monitoringExporterSrcDir = monitoringExporterDir + "/src" ;
172
+ // target dir for monitoring exporter webapp
173
+ String monitoringExporterWar =
174
+ monitoringExporterDir + "/apps/monitoringexporter/wls-exporter.war" ;
175
+
176
+ // build monitoring exporter project
177
+ StringBuffer buildExporter = new StringBuffer ();
178
+ buildExporter
179
+ .append ("cd " + monitoringExporterSrcDir )
180
+ .append (" && " )
181
+ .append (" mvn clean install --log-file output.txt" );
182
+ TestUtils .exec (buildExporter .toString ());
183
+
184
+ // build monitoring monitoring exporter webapp
185
+ StringBuffer buildExporterWar = new StringBuffer ();
186
+ buildExporterWar
187
+ .append ("cd " + monitoringExporterSrcDir + "/webapp" )
188
+ .append (" && " )
189
+ .append ("mvn package -Dconfiguration=" )
190
+ .append (resourceExporterDir + "/rest_webapp.yml" )
191
+ .append (" --log-file output1.txt" );
192
+ TestUtils .exec (buildExporterWar .toString ());
193
+
194
+ // build coordinator image
195
+ StringBuffer buildCoordinatorImage = new StringBuffer ();
196
+ buildCoordinatorImage
197
+ .append ("cd " + monitoringExporterSrcDir + "/config_coordinator" )
198
+ .append (" && " )
199
+ .append (" docker build -t config_coordinator . " );
200
+ TestUtils .exec (buildCoordinatorImage .toString ());
201
+
202
+ // copy created war file to desired destination
203
+ buildExporterWar = new StringBuffer ();
204
+ buildExporterWar
205
+ .append (" mkdir " + monitoringExporterDir + "/apps" )
206
+ .append (" && mkdir " + monitoringExporterDir + "/apps/monitoringexporter" )
207
+ .append (" && " )
208
+ .append (" cp " + monitoringExporterSrcDir )
209
+ .append ("/webapp/target/wls-exporter.war " )
210
+ .append (monitoringExporterWar );
211
+ TestUtils .exec (buildExporterWar .toString ());
212
+ }
213
+
202
214
private static void deployMonitoringExporterPrometethusGrafana (
203
215
String exporterAppPath , Domain domain , Operator operator ) throws Exception {
204
216
@@ -315,7 +327,8 @@ private static void createCrossNsRbacFile(String domainNS, String operatorNS) th
315
327
*/
316
328
private static void deployRunMonitoringExporter (Domain domain , Operator operator )
317
329
throws Exception {
318
- gitCloneBuildMonitoringExporter ();
330
+ gitCloneMonitoringExporter ();
331
+ buildMonitoringExporter ();
319
332
logger .info ("Creating Operator & waiting for the script to complete execution" );
320
333
boolean testCompletedSuccessfully = false ;
321
334
startExporterPrometheusGrafana (domain , operator );
@@ -797,6 +810,7 @@ public void test19_EndToEndViaChart() throws Exception {
797
810
domain = null ;
798
811
}
799
812
tearDown (new Object () {}.getClass ().getEnclosingClass ().getSimpleName ());
813
+ gitCloneMonitoringExporter ();
800
814
setupPVMYSQL ();
801
815
createWLSImageAndDeploy ();
802
816
installPrometheusGrafanaViaChart ();
0 commit comments