integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java
public void buildDeployJavaAppInPod(
      String appName, String scriptName, String username, String password, String... args)
      throws Exception {
    final String adminServerPod = domainUid + "-" + adminServerName;

    String appLocationOnHost = BaseTest.getAppLocationOnHost() + "/" + appName;
    String appLocationInPod = BaseTest.getAppLocationInPod() + "/" + appName;
    final String scriptPathOnHost = BaseTest.getAppLocationOnHost() + "/" + scriptName;
    final String scriptPathInPod = BaseTest.getAppLocationInPod() + "/" + scriptName;

    // Default values to build archive file
    final String initInfoDirName = "WEB-INF";
    String archiveExt = "war";
    String infoDirName = initInfoDirName;

    // Get archive info dir name
    File appFiles = new File(appLocationOnHost);

    String[] subDirArr =
        appFiles.list(
            new FilenameFilter() {
              @Override
              public boolean accept(File dir, String name) {
                return name.equals(initInfoDirName);
              }
            });

    List<String> subDirList = Arrays.asList(subDirArr);

    // Check archive file type
    if (!subDirList.contains(infoDirName)) {
      infoDirName = "META-INF";

      // Create .ear file or .jar file for EJB
      archiveExt = (args.length == 0) ? "ear" : args[0];
    }

    LoggerHelper.getLocal().log(Level.INFO,
        "Build and deploy: " + appName + "." + archiveExt + " in the admin pod");

    // Create app dir in the admin pod
    StringBuffer mkdirCmd = new StringBuffer(" -- bash -c 'mkdir -p ");
    mkdirCmd.append(appLocationInPod).append("/" + infoDirName + "'");
    TestUtils.kubectlexec(adminServerPod, domainNS, mkdirCmd.toString());

    // Copy shell script to the pod
    TestUtils.copyFileViaCat(scriptPathOnHost, scriptPathInPod, adminServerPod, domainNS);

    // Copy all App files to the admin pod
    TestUtils.copyAppFilesToPod(appLocationOnHost, appLocationInPod, adminServerPod, domainNS);
    // Run the script to build WAR, EAR or JAR file and deploy the App in the admin pod
    callShellScriptToBuildDeployAppInPod(
        appName, scriptName, username, password, infoDirName, archiveExt);
  }
/**
   * Create dir to save Web App files Copy the shell script file and all App files over to the admin
   * pod Run the shell script to build WAR, EAR or JAR file and deploy the App in the admin pod.
   *
   * @param appName    - Java 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       - by default, a WAR file is created for a Web App and a EAR file is created for EJB
   *                   App. this varargs gives a client a chance to change EJB's archive extenyion to JAR
   * @throws Exception If failed to build or deploy the app
   */
Create dir to save Web App files Copy the shell script file and all App files over to the admin
pod Run the shell script to build WAR, EAR or JAR file and deploy the App in the admin pod.


Create dir to save Web App files Copy the shell script file and all App files over to the admin pod Run the shell script to build WAR EAR or JAR file and deploy the App in the admin pod .
public void buildDeployJavaAppInPod(
      String appName, String scriptName, String username, String password, String... args)
      throws Exception {
    final String adminServerPod = domainUid + "-" + adminServerName;
    String appLocationOnHost = BaseTest.getAppLocationOnHost() + "/" + appName;
    String appLocationInPod = BaseTest.getAppLocationInPod() + "/" + appName;
    final String scriptPathOnHost = BaseTest.getAppLocationOnHost() + "/" + scriptName;
    final String scriptPathInPod = BaseTest.getAppLocationInPod() + "/" + scriptName;
    final String initInfoDirName = "WEB-INF";
    String archiveExt = "war";
    String infoDirName = initInfoDirName;
    File appFiles = new File(appLocationOnHost);
    String[] subDirArr =
        appFiles.list(
            new FilenameFilter() {
              @Override
              public boolean accept(File dir, String name) {
                return name.equals(initInfoDirName);
              }
            });
    List<String> subDirList = Arrays.asList(subDirArr);
    if (!subDirList.contains(infoDirName)) {
      infoDirName = "META-INF";
      archiveExt = (args.length == 0) ? "ear" : args[0];
    }
    LoggerHelper.getLocal().log(Level.INFO,
        "Build and deploy: " + appName + "." + archiveExt + " in the admin pod");
    StringBuffer mkdirCmd = new StringBuffer(" -- bash -c 'mkdir -p ");
    mkdirCmd.append(appLocationInPod).append("/" + infoDirName + "'");
    TestUtils.kubectlexec(adminServerPod, domainNS, mkdirCmd.toString());
    TestUtils.copyFileViaCat(scriptPathOnHost, scriptPathInPod, adminServerPod, domainNS);
    TestUtils.copyAppFilesToPod(appLocationOnHost, appLocationInPod, adminServerPod, domainNS);
    callShellScriptToBuildDeployAppInPod(
        appName, scriptName, username, password, infoDirName, archiveExt);
  }
public void buildDeployJavaAppInPod ( String appName , String scriptName , String username , String password , String ... args ) throws Exception { final String adminServerPod = domainUid + "-" + adminServerName ; String appLocationOnHost = BaseTest . getAppLocationOnHost ( ) + "/" + appName ; String appLocationInPod = BaseTest . getAppLocationInPod ( ) + "/" + appName ; final String scriptPathOnHost = BaseTest . getAppLocationOnHost ( ) + "/" + scriptName ; final String scriptPathInPod = BaseTest . getAppLocationInPod ( ) + "/" + scriptName ; final String initInfoDirName = "WEB-INF" ; String archiveExt = "war" ; String infoDirName = initInfoDirName ; File appFiles = new File ( appLocationOnHost ) ; String [ ] subDirArr = appFiles . list ( new FilenameFilter ( ) { @ Override public boolean accept ( File dir , String name ) { return name . equals ( initInfoDirName ) ; } } ) ; List < String > subDirList = Arrays . asList ( subDirArr ) ; if ( ! subDirList . contains ( infoDirName ) ) { infoDirName = "META-INF" ; archiveExt = ( args . length == 0 ) ? "ear" : args [ 0 ] ; } LoggerHelper . getLocal ( ) . log ( Level . INFO , "Build and deploy: " + appName + "." + archiveExt + " in the admin pod" ) ; StringBuffer mkdirCmd = new StringBuffer ( " -- bash -c 'mkdir -p " ) ; mkdirCmd . append ( appLocationInPod ) . append ( "/" + infoDirName + "'" ) ; TestUtils . kubectlexec ( adminServerPod , domainNS , mkdirCmd . toString ( ) ) ; TestUtils . copyFileViaCat ( scriptPathOnHost , scriptPathInPod , adminServerPod , domainNS ) ; TestUtils . copyAppFilesToPod ( appLocationOnHost , appLocationInPod , adminServerPod , domainNS ) ; callShellScriptToBuildDeployAppInPod ( appName , scriptName , username , password , infoDirName , archiveExt ) ; }
Create dir to save Web App files Copy the shell script file and all App files over to the admin
 pod Run the shell script to build WAR, EAR or JAR file and deploy the App in the admin pod.
Create dir to save Web App files Copy the shell script file and all App files over to the admin pod Run the shell script to build WAR EAR or JAR file and deploy the App in the admin pod .
// Default values to build archive file // Get archive info dir name // Check archive file type // Create .ear file or .jar file for EJB // Create app dir in the admin pod // Copy shell script to the pod // Copy all App files to the admin pod // Run the script to build WAR, EAR or JAR file and deploy the App in the admin pod