18
18
import static java .util .concurrent .TimeUnit .MINUTES ;
19
19
import static java .util .concurrent .TimeUnit .SECONDS ;
20
20
import static oracle .weblogic .kubernetes .TestConstants .K8S_NODEPORT_HOST ;
21
- import static oracle .weblogic .kubernetes .TestConstants .MONITORING_EXPORTER_VERSION ;
21
+ import static oracle .weblogic .kubernetes .TestConstants .MONITORING_EXPORTER_WEBAPP_VERSION ;
22
22
import static oracle .weblogic .kubernetes .actions .ActionConstants .RESOURCE_DIR ;
23
23
import static oracle .weblogic .kubernetes .utils .FileUtils .checkDirectory ;
24
24
import static oracle .weblogic .kubernetes .utils .FileUtils .checkFile ;
@@ -39,17 +39,21 @@ public class MonitoringUtils {
39
39
*/
40
40
public static void downloadMonitoringExporterApp (String configFile , String applicationDir ) {
41
41
LoggingFacade logger = getLogger ();
42
- String monitoringExporterVersion = Optional .ofNullable (System .getenv ("MONITORING_EXPORTER_VERSION" ))
43
- .orElse (MONITORING_EXPORTER_VERSION );
42
+ //version of wls-exporter.war published in https://github.com/oracle/weblogic-monitoring-exporter/releases/
43
+ String monitoringExporterWebAppVersion = Optional .ofNullable (System .getenv ("MONITORING_EXPORTER_WEBAPP_VERSION" ))
44
+ .orElse (MONITORING_EXPORTER_WEBAPP_VERSION );
45
+
44
46
String monitoringExporterBuildFile = String .format (
45
- "%s/get%s.sh" , applicationDir , monitoringExporterVersion );
47
+ "%s/get%s.sh" , applicationDir , monitoringExporterWebAppVersion );
46
48
checkDirectory (applicationDir );
47
49
logger .info ("Download a monitoring exporter build file {0} " , monitoringExporterBuildFile );
50
+ String monitoringExporterRelease =
51
+ monitoringExporterWebAppVersion .equals ("2.0" ) ? "2.0.0" : monitoringExporterWebAppVersion ;
48
52
String curlDownloadCmd = String .format ("cd %s && "
49
53
+ "curl -O -L -k https://github.com/oracle/weblogic-monitoring-exporter/releases/download/v%s/get%s.sh" ,
50
54
applicationDir ,
51
- monitoringExporterVersion ,
52
- monitoringExporterVersion );
55
+ monitoringExporterRelease ,
56
+ monitoringExporterWebAppVersion );
53
57
logger .info ("execute command a monitoring exporter curl command {0} " , curlDownloadCmd );
54
58
assertTrue (new Command ()
55
59
.withParams (new CommandParams ()
0 commit comments