integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java
public void callShellScriptToBuildDeployAppInPod(
      String webappName, String scriptName, String username, String password, String... args)
      throws Exception {

    String nodeHost = getHostNameForCurl();
    String nodePort = getNodePort();
    String appLocationInPod = BaseTest.getAppLocationInPod();

    StringBuffer cmdKubectlSh = new StringBuffer("kubectl -n ");
    cmdKubectlSh
        .append(domainNS)
        .append(" exec -it ")
        .append(domainUid)
        .append("-")
        .append(adminServerName)
        .append(" -- bash -c 'chmod +x -R ")
        .append(appLocationInPod)
        .append(" && sh ")
        .append(appLocationInPod)
        .append("/")
        .append(scriptName)
        .append(" ")
        .append(nodeHost)
        .append(" ")
        .append(nodePort)
        .append(" ")
        .append(username)
        .append(" ")
        .append(password)
        .append(" ")
        .append(appLocationInPod)
        .append("/")
        .append(webappName)
        .append(" ")
        .append(webappName)
        .append(" ")
        .append(clusterName)
        .append(" ")
        .append(String.join(" ", args).toString())
        .append("'");

    LoggerHelper.getLocal().log(Level.INFO, "Command to exec script file: " + cmdKubectlSh);
    ExecResult result = ExecCommand.exec(cmdKubectlSh.toString());

    String resultStr =
        "Command= '"
            + cmdKubectlSh
            + "'"
            + ", exitValue="
            + result.exitValue()
            + ", stdout='"
            + result.stdout()
            + "'"
            + ", stderr='"
            + result.stderr()
            + "'";
    LoggerHelper.getLocal().log(Level.INFO, "App deploy result " + resultStr);
    if (!resultStr.contains("Unable to use a TTY") && result.exitValue() != 0) {
      throw new RuntimeException("FAILURE: webapp deploy failed - " + resultStr);
    }
  }
/**
   * Run the shell script to build WAR, EAR or JAR file and deploy the App in the admin pod.
   *
   * @param webappName - Web App Name to be deployed
   * @param scriptName - a shell script to build WAR, EAR or JAR file and deploy the App in the
   *                   admin pod
   * @param username   - weblogic user name
   * @param password   - weblogc password
   * @param args       - optional args to add for script if needed
   * @throws Exception If fails to execute the script
   */
Run the shell script to build WAR, EAR or JAR file and deploy the App in the admin pod.
Run the shell script to build WAR EAR or JAR file and deploy the App in the admin pod .
public void callShellScriptToBuildDeployAppInPod(
      String webappName, String scriptName, String username, String password, String... args)
      throws Exception {
    String nodeHost = getHostNameForCurl();
    String nodePort = getNodePort();
    String appLocationInPod = BaseTest.getAppLocationInPod();
    StringBuffer cmdKubectlSh = new StringBuffer("kubectl -n ");
    cmdKubectlSh
        .append(domainNS)
        .append(" exec -it ")
        .append(domainUid)
        .append("-")
        .append(adminServerName)
        .append(" -- bash -c 'chmod +x -R ")
        .append(appLocationInPod)
        .append(" && sh ")
        .append(appLocationInPod)
        .append("/")
        .append(scriptName)
        .append(" ")
        .append(nodeHost)
        .append(" ")
        .append(nodePort)
        .append(" ")
        .append(username)
        .append(" ")
        .append(password)
        .append(" ")
        .append(appLocationInPod)
        .append("/")
        .append(webappName)
        .append(" ")
        .append(webappName)
        .append(" ")
        .append(clusterName)
        .append(" ")
        .append(String.join(" ", args).toString())
        .append("'");
    LoggerHelper.getLocal().log(Level.INFO, "Command to exec script file: " + cmdKubectlSh);
    ExecResult result = ExecCommand.exec(cmdKubectlSh.toString());
    String resultStr =
        "Command= '"
            + cmdKubectlSh
            + "'"
            + ", exitValue="
            + result.exitValue()
            + ", stdout='"
            + result.stdout()
            + "'"
            + ", stderr='"
            + result.stderr()
            + "'";
    LoggerHelper.getLocal().log(Level.INFO, "App deploy result " + resultStr);
    if (!resultStr.contains("Unable to use a TTY") && result.exitValue() != 0) {
      throw new RuntimeException("FAILURE: webapp deploy failed - " + resultStr);
    }
  }
public void callShellScriptToBuildDeployAppInPod ( String webappName , String scriptName , String username , String password , String ... args ) throws Exception { String nodeHost = getHostNameForCurl ( ) ; String nodePort = getNodePort ( ) ; String appLocationInPod = BaseTest . getAppLocationInPod ( ) ; StringBuffer cmdKubectlSh = new StringBuffer ( "kubectl -n " ) ; cmdKubectlSh . append ( domainNS ) . append ( " exec -it " ) . append ( domainUid ) . append ( "-" ) . append ( adminServerName ) . append ( " -- bash -c 'chmod +x -R " ) . append ( appLocationInPod ) . append ( " && sh " ) . append ( appLocationInPod ) . append ( "/" ) . append ( scriptName ) . append ( " " ) . append ( nodeHost ) . append ( " " ) . append ( nodePort ) . append ( " " ) . append ( username ) . append ( " " ) . append ( password ) . append ( " " ) . append ( appLocationInPod ) . append ( "/" ) . append ( webappName ) . append ( " " ) . append ( webappName ) . append ( " " ) . append ( clusterName ) . append ( " " ) . append ( String . join ( " " , args ) . toString ( ) ) . append ( "'" ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Command to exec script file: " + cmdKubectlSh ) ; ExecResult result = ExecCommand . exec ( cmdKubectlSh . toString ( ) ) ; String resultStr = "Command= '" + cmdKubectlSh + "'" + ", exitValue=" + result . exitValue ( ) + ", stdout='" + result . stdout ( ) + "'" + ", stderr='" + result . stderr ( ) + "'" ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "App deploy result " + resultStr ) ; if ( ! resultStr . contains ( "Unable to use a TTY" ) && result . exitValue ( ) != 0 ) { throw new RuntimeException ( "FAILURE: webapp deploy failed - " + resultStr ) ; } }
Run the shell script to build WAR, EAR or JAR file and deploy the App in the admin pod.
Run the shell script to build WAR EAR or JAR file and deploy the App in the admin pod .