integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java
public void deployWebAppViaRest(
      String webappName, String webappLocation, String username, String password) throws Exception {
    StringBuffer cmd = new StringBuffer();
    cmd.append("curl --noproxy '*' --silent  --user ")
        .append(username)
        .append(":")
        .append(password)
        .append(" -H X-Requested-By:MyClient -H Accept:application/json")
        .append(" -H Content-Type:multipart/form-data -F \"model={ name: '")
        .append(webappName)
        .append("', targets: [ { identity: [ clusters, '")
        .append(clusterName)
        .append("' ] } ] }\" -F \"sourcePath=@")
        .append(webappLocation)
        .append("\" -H \"Prefer:respond-async\" -X POST http://")
        .append(getNodeHost())
        .append(":")
        .append(getNodePort())
        .append("/management/weblogic/latest/edit/appDeployments")
        .append(" --write-out %{http_code} ");
    LoggerHelper.getLocal().log(Level.INFO, "Command to deploy webapp " + cmd);
    ExecResult result = TestUtils.execOrAbortProcess(cmd.toString());
    String output = result.stdout().trim();
    LoggerHelper.getLocal().log(Level.INFO, "curl output " + output + " \n err " + result.stderr());
    if (!output.contains("202")) {
      throw new RuntimeException("FAILURE: Webapp deployment failed with response code " + output);
    }
  }
/**
   * Deploy webapp using nodehost and nodeport.
   *
   * @throws Exception if failed to deploy the app
   */
Deploy webapp using nodehost and nodeport.
@throws Exception if failed to deploy the app
Deploy webapp using nodehost and nodeport . @throws Exception if failed to deploy the app
public void deployWebAppViaRest(
      String webappName, String webappLocation, String username, String password) throws Exception {
    StringBuffer cmd = new StringBuffer();
    cmd.append("curl --noproxy '*' --silent  --user ")
        .append(username)
        .append(":")
        .append(password)
        .append(" -H X-Requested-By:MyClient -H Accept:application/json")
        .append(" -H Content-Type:multipart/form-data -F \"model={ name: '")
        .append(webappName)
        .append("', targets: [ { identity: [ clusters, '")
        .append(clusterName)
        .append("' ] } ] }\" -F \"sourcePath=@")
        .append(webappLocation)
        .append("\" -H \"Prefer:respond-async\" -X POST http://")
        .append(getNodeHost())
        .append(":")
        .append(getNodePort())
        .append("/management/weblogic/latest/edit/appDeployments")
        .append(" --write-out %{http_code} ");
    LoggerHelper.getLocal().log(Level.INFO, "Command to deploy webapp " + cmd);
    ExecResult result = TestUtils.execOrAbortProcess(cmd.toString());
    String output = result.stdout().trim();
    LoggerHelper.getLocal().log(Level.INFO, "curl output " + output + " \n err " + result.stderr());
    if (!output.contains("202")) {
      throw new RuntimeException("FAILURE: Webapp deployment failed with response code " + output);
    }
  }
public void deployWebAppViaRest ( String webappName , String webappLocation , String username , String password ) throws Exception { StringBuffer cmd = new StringBuffer ( ) ; cmd . append ( "curl --noproxy '*' --silent  --user " ) . append ( username ) . append ( ":" ) . append ( password ) . append ( " -H X-Requested-By:MyClient -H Accept:application/json" ) . append ( " -H Content-Type:multipart/form-data -F \"model={ name: '" ) . append ( webappName ) . append ( "', targets: [ { identity: [ clusters, '" ) . append ( clusterName ) . append ( "' ] } ] }\" -F \"sourcePath=@" ) . append ( webappLocation ) . append ( "\" -H \"Prefer:respond-async\" -X POST http://" ) . append ( getNodeHost ( ) ) . append ( ":" ) . append ( getNodePort ( ) ) . append ( "/management/weblogic/latest/edit/appDeployments" ) . append ( " --write-out %{http_code} " ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Command to deploy webapp " + cmd ) ; ExecResult result = TestUtils . execOrAbortProcess ( cmd . toString ( ) ) ; String output = result . stdout ( ) . trim ( ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "curl output " + output + " \n err " + result . stderr ( ) ) ; if ( ! output . contains ( "202" ) ) { throw new RuntimeException ( "FAILURE: Webapp deployment failed with response code " + output ) ; } }
Deploy webapp using nodehost and nodeport.
Deploy webapp using nodehost and nodeport .