new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMonitoringExporter.java
private static void installMonitoringExporter() {
    logger.info("create a staging location for monitoring exporter github");
    Path monitoringTemp = Paths.get(RESULTS_ROOT, "monitoringexp", "srcdir");
    assertDoesNotThrow(() -> FileUtils.deleteDirectory(monitoringTemp.toFile()));
    assertDoesNotThrow(() -> Files.createDirectories(monitoringTemp));
    Path monitoringApp = Paths.get(RESULTS_ROOT, "monitoringexp", "apps");
    assertDoesNotThrow(() -> FileUtils.deleteDirectory(monitoringApp.toFile()));
    assertDoesNotThrow(() -> Files.createDirectories(monitoringApp));

    CommandParams params = Command.defaultCommandParams()
        .command("git clone " + MONITORING_EXPORTER_DOWNLOAD_URL + " " + monitoringTemp)
        .saveResults(true)
        .redirect(false);
    assertTrue(() -> Command.withParams(params)
        .execute());

    monitoringExporterSrcDir = monitoringTemp.toString();
    monitoringExporterEndToEndDir = monitoringTemp + "/samples/kubernetes/end2end/";
    String monitoringExporterVersion = Optional.ofNullable(System.getenv("MONITORING_EXPORTER_VERSION"))
        .orElse(MONITORING_EXPORTER_VERSION);
    logger.info("create a monitoring exporter version {0} ",monitoringExporterVersion);
    monitoringExporterAppDir = monitoringApp.toString();
    String monitoringExporterBuildFile = String.format(
        "%s/get%s.sh", monitoringExporterAppDir, monitoringExporterVersion);
    logger.info("Download a monitoring exporter build file {0} ", monitoringExporterBuildFile);
    String curlDownloadCmd = String.format("cd %s && "
        + "curl -O -L -k https://github.com/oracle/weblogic-monitoring-exporter/releases/download/v%s/get%s.sh",
        monitoringExporterAppDir,
        monitoringExporterVersion,
        monitoringExporterVersion);
    logger.info("execute command  a monitoring exporter curl command {0} ",curlDownloadCmd);
    assertTrue(new Command()
        .withParams(new CommandParams()
            .command(curlDownloadCmd))
        .execute(),"Failed to download monitoring exporter webapp");
    String command = String.format("chmod 777 %s ", monitoringExporterBuildFile);
    assertTrue(new Command()
        .withParams(new CommandParams()
            .command(command))
        .execute(),"Failed to build monitoring exporter webapp");
    String appDest = monitoringExporterAppDir;
    command = String.format("cd %s && %s  %s/exporter/exporter-config.yaml",
            appDest,
            monitoringExporterBuildFile,
            RESOURCE_DIR);
    assertTrue(new Command()
        .withParams(new CommandParams()
            .command(command))
        .execute(),"Failed to build monitoring exporter webapp");
  }
//download src from monitoring exporter github project and build webapp.
download src from monitoring exporter github project and build webapp.
download src from monitoring exporter github project and build webapp .
private static void installMonitoringExporter() {
    logger.info("create a staging location for monitoring exporter github");
    Path monitoringTemp = Paths.get(RESULTS_ROOT, "monitoringexp", "srcdir");
    assertDoesNotThrow(() -> FileUtils.deleteDirectory(monitoringTemp.toFile()));
    assertDoesNotThrow(() -> Files.createDirectories(monitoringTemp));
    Path monitoringApp = Paths.get(RESULTS_ROOT, "monitoringexp", "apps");
    assertDoesNotThrow(() -> FileUtils.deleteDirectory(monitoringApp.toFile()));
    assertDoesNotThrow(() -> Files.createDirectories(monitoringApp));
    CommandParams params = Command.defaultCommandParams()
        .command("git clone " + MONITORING_EXPORTER_DOWNLOAD_URL + " " + monitoringTemp)
        .saveResults(true)
        .redirect(false);
    assertTrue(() -> Command.withParams(params)
        .execute());
    monitoringExporterSrcDir = monitoringTemp.toString();
    monitoringExporterEndToEndDir = monitoringTemp + "/samples/kubernetes/end2end/";
    String monitoringExporterVersion = Optional.ofNullable(System.getenv("MONITORING_EXPORTER_VERSION"))
        .orElse(MONITORING_EXPORTER_VERSION);
    logger.info("create a monitoring exporter version {0} ",monitoringExporterVersion);
    monitoringExporterAppDir = monitoringApp.toString();
    String monitoringExporterBuildFile = String.format(
        "%s/get%s.sh", monitoringExporterAppDir, monitoringExporterVersion);
    logger.info("Download a monitoring exporter build file {0} ", monitoringExporterBuildFile);
    String curlDownloadCmd = String.format("cd %s && "
        + "curl -O -L -k https://github.com/oracle/weblogic-monitoring-exporter/releases/download/v%s/get%s.sh",
        monitoringExporterAppDir,
        monitoringExporterVersion,
        monitoringExporterVersion);
    logger.info("execute command  a monitoring exporter curl command {0} ",curlDownloadCmd);
    assertTrue(new Command()
        .withParams(new CommandParams()
            .command(curlDownloadCmd))
        .execute(),"Failed to download monitoring exporter webapp");
    String command = String.format("chmod 777 %s ", monitoringExporterBuildFile);
    assertTrue(new Command()
        .withParams(new CommandParams()
            .command(command))
        .execute(),"Failed to build monitoring exporter webapp");
    String appDest = monitoringExporterAppDir;
    command = String.format("cd %s && %s  %s/exporter/exporter-config.yaml",
            appDest,
            monitoringExporterBuildFile,
            RESOURCE_DIR);
    assertTrue(new Command()
        .withParams(new CommandParams()
            .command(command))
        .execute(),"Failed to build monitoring exporter webapp");
  }
private static void installMonitoringExporter ( ) { logger . info ( "create a staging location for monitoring exporter github" ) ; Path monitoringTemp = Paths . get ( RESULTS_ROOT , "monitoringexp" , "srcdir" ) ; assertDoesNotThrow ( ( ) -> FileUtils . deleteDirectory ( monitoringTemp . toFile ( ) ) ) ; assertDoesNotThrow ( ( ) -> Files . createDirectories ( monitoringTemp ) ) ; Path monitoringApp = Paths . get ( RESULTS_ROOT , "monitoringexp" , "apps" ) ; assertDoesNotThrow ( ( ) -> FileUtils . deleteDirectory ( monitoringApp . toFile ( ) ) ) ; assertDoesNotThrow ( ( ) -> Files . createDirectories ( monitoringApp ) ) ; CommandParams params = Command . defaultCommandParams ( ) . command ( "git clone " + MONITORING_EXPORTER_DOWNLOAD_URL + " " + monitoringTemp ) . saveResults ( true ) . redirect ( false ) ; assertTrue ( ( ) -> Command . withParams ( params ) . execute ( ) ) ; monitoringExporterSrcDir = monitoringTemp . toString ( ) ; monitoringExporterEndToEndDir = monitoringTemp + "/samples/kubernetes/end2end/" ; String monitoringExporterVersion = Optional . ofNullable ( System . getenv ( "MONITORING_EXPORTER_VERSION" ) ) . orElse ( MONITORING_EXPORTER_VERSION ) ; logger . info ( "create a monitoring exporter version {0} " , monitoringExporterVersion ) ; monitoringExporterAppDir = monitoringApp . toString ( ) ; String monitoringExporterBuildFile = String . format ( "%s/get%s.sh" , monitoringExporterAppDir , monitoringExporterVersion ) ; logger . info ( "Download a monitoring exporter build file {0} " , monitoringExporterBuildFile ) ; String curlDownloadCmd = String . format ( "cd %s && " + "curl -O -L -k https://github.com/oracle/weblogic-monitoring-exporter/releases/download/v%s/get%s.sh" , monitoringExporterAppDir , monitoringExporterVersion , monitoringExporterVersion ) ; logger . info ( "execute command  a monitoring exporter curl command {0} " , curlDownloadCmd ) ; assertTrue ( new Command ( ) . withParams ( new CommandParams ( ) . command ( curlDownloadCmd ) ) . execute ( ) , "Failed to download monitoring exporter webapp" ) ; String command = String . format ( "chmod 777 %s " , monitoringExporterBuildFile ) ; assertTrue ( new Command ( ) . withParams ( new CommandParams ( ) . command ( command ) ) . execute ( ) , "Failed to build monitoring exporter webapp" ) ; String appDest = monitoringExporterAppDir ; command = String . format ( "cd %s && %s  %s/exporter/exporter-config.yaml" , appDest , monitoringExporterBuildFile , RESOURCE_DIR ) ; assertTrue ( new Command ( ) . withParams ( new CommandParams ( ) . command ( command ) ) . execute ( ) , "Failed to build monitoring exporter webapp" ) ; }
download src from monitoring exporter github project and build webapp.
download src from monitoring exporter github project and build webapp .