integration-tests/src/test/java/oracle/kubernetes/operator/MiiConfigUpdateBaseTest.java
protected void wdtConfigUpdateImage(Map<String, Object> domainMap, String imageName,
                                      String modelFile, String modelPropFile) {
    // get domain base image, domain UID and domain name
    final String domainBaseImageName = (String) domainMap.get("domainHomeImageBase");
    final String domainUid = (String) domainMap.get("domainUID");
    final String domainName = (String) domainMap.get("domainName");
    ExecResult result = null;

    // Get the map of any additional environment vars, or null
    Map<String, String> additionalEnvMap = (Map<String, String>) domainMap.get("additionalEnvMap");
    final String resultsDir = (String) domainMap.get("resultDir");
    StringBuffer createDomainImageScriptCmd = new StringBuffer("export WDT_VERSION=");

    createDomainImageScriptCmd.append(BaseTest.WDT_VERSION).append(" && ")
      .append(getUserProjectsDir())
      .append("/weblogic-domains/")
      .append(domainName)
      .append("/miiWorkDir/")
      .append("imagetool/bin/imagetool.sh update")
      .append(" --tag ")
      .append(imageName)
      .append(" --fromImage ")
      .append(domainBaseImageName)
      .append(" --wdtModel ")
      .append(resultsDir)
      .append("/samples/model-in-image/")
      .append(modelFile)
      .append(" --wdtVariables ")
      .append(resultsDir)
      .append("/samples/model-in-image/")
      .append(modelPropFile)
      .append(" --wdtArchive ")
      .append(getUserProjectsDir())
      .append("/weblogic-domains/")
      .append(domainName)
      .append("/miiWorkDir/models/archive.zip")
      .append(" --wdtModelOnly ")
      .append(" --wdtDomainType ")
      .append(WdtDomainType.WLS.geWdtDomainType());

    try {
      // create a new or update an existing image
      LoggerHelper.getLocal().log(Level.INFO, "Command to create domain image: "
          + createDomainImageScriptCmd);
      result = ExecCommand.exec(createDomainImageScriptCmd.toString(), true, additionalEnvMap);
    } catch (Exception ex) {
      ex.printStackTrace();
      StringBuffer errorMsg = new StringBuffer("FAILURE: command: ");
      errorMsg
          .append(createDomainImageScriptCmd)
          .append(" failed, returned ")
          .append(result.stdout())
          .append("\n")
          .append(result.stderr());

      fail(errorMsg.toString(), ex.getCause());
    }
  }
/**
   * Create a new or update an existing image using model in image.
   * @param domainMap a Java Map object stores key and value pairs used to create the Domain
   * @param imageName image name to be created or updated
   * @param modelFile a model to describe a WebLogic Server domain configuration.
   * @param modelPropFile a file to specify values of variable tokens declared in model file(s) at runtime
   */
Create a new or update an existing image using model in image.
@param domainMap a Java Map object stores key and value pairs used to create the Domain
@param imageName image name to be created or updated
@param modelFile a model to describe a WebLogic Server domain configuration.
@param modelPropFile a file to specify values of variable tokens declared in model file(s) at runtime
Create a new or update an existing image using model in image . @param domainMap a Java Map object stores key and value pairs used to create the Domain @param imageName image name to be created or updated @param modelFile a model to describe a WebLogic Server domain configuration . @param modelPropFile a file to specify values of variable tokens declared in model file ( s ) at runtime
protected void wdtConfigUpdateImage(Map<String, Object> domainMap, String imageName,
                                      String modelFile, String modelPropFile) {
    final String domainBaseImageName = (String) domainMap.get("domainHomeImageBase");
    final String domainUid = (String) domainMap.get("domainUID");
    final String domainName = (String) domainMap.get("domainName");
    ExecResult result = null;
    Map<String, String> additionalEnvMap = (Map<String, String>) domainMap.get("additionalEnvMap");
    final String resultsDir = (String) domainMap.get("resultDir");
    StringBuffer createDomainImageScriptCmd = new StringBuffer("export WDT_VERSION=");
    createDomainImageScriptCmd.append(BaseTest.WDT_VERSION).append(" && ")
      .append(getUserProjectsDir())
      .append("/weblogic-domains/")
      .append(domainName)
      .append("/miiWorkDir/")
      .append("imagetool/bin/imagetool.sh update")
      .append(" --tag ")
      .append(imageName)
      .append(" --fromImage ")
      .append(domainBaseImageName)
      .append(" --wdtModel ")
      .append(resultsDir)
      .append("/samples/model-in-image/")
      .append(modelFile)
      .append(" --wdtVariables ")
      .append(resultsDir)
      .append("/samples/model-in-image/")
      .append(modelPropFile)
      .append(" --wdtArchive ")
      .append(getUserProjectsDir())
      .append("/weblogic-domains/")
      .append(domainName)
      .append("/miiWorkDir/models/archive.zip")
      .append(" --wdtModelOnly ")
      .append(" --wdtDomainType ")
      .append(WdtDomainType.WLS.geWdtDomainType());
    try {
      LoggerHelper.getLocal().log(Level.INFO, "Command to create domain image: "
          + createDomainImageScriptCmd);
      result = ExecCommand.exec(createDomainImageScriptCmd.toString(), true, additionalEnvMap);
    } catch (Exception ex) {
      ex.printStackTrace();
      StringBuffer errorMsg = new StringBuffer("FAILURE: command: ");
      errorMsg
          .append(createDomainImageScriptCmd)
          .append(" failed, returned ")
          .append(result.stdout())
          .append("\n")
          .append(result.stderr());
      fail(errorMsg.toString(), ex.getCause());
    }
  }
protected void wdtConfigUpdateImage ( Map < String , Object > domainMap , String imageName , String modelFile , String modelPropFile ) { final String domainBaseImageName = ( String ) domainMap . get ( "domainHomeImageBase" ) ; final String domainUid = ( String ) domainMap . get ( "domainUID" ) ; final String domainName = ( String ) domainMap . get ( "domainName" ) ; ExecResult result = null ; Map < String , String > additionalEnvMap = ( Map < String , String > ) domainMap . get ( "additionalEnvMap" ) ; final String resultsDir = ( String ) domainMap . get ( "resultDir" ) ; StringBuffer createDomainImageScriptCmd = new StringBuffer ( "export WDT_VERSION=" ) ; createDomainImageScriptCmd . append ( BaseTest . WDT_VERSION ) . append ( " && " ) . append ( getUserProjectsDir ( ) ) . append ( "/weblogic-domains/" ) . append ( domainName ) . append ( "/miiWorkDir/" ) . append ( "imagetool/bin/imagetool.sh update" ) . append ( " --tag " ) . append ( imageName ) . append ( " --fromImage " ) . append ( domainBaseImageName ) . append ( " --wdtModel " ) . append ( resultsDir ) . append ( "/samples/model-in-image/" ) . append ( modelFile ) . append ( " --wdtVariables " ) . append ( resultsDir ) . append ( "/samples/model-in-image/" ) . append ( modelPropFile ) . append ( " --wdtArchive " ) . append ( getUserProjectsDir ( ) ) . append ( "/weblogic-domains/" ) . append ( domainName ) . append ( "/miiWorkDir/models/archive.zip" ) . append ( " --wdtModelOnly " ) . append ( " --wdtDomainType " ) . append ( WdtDomainType . WLS . geWdtDomainType ( ) ) ; try { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Command to create domain image: " + createDomainImageScriptCmd ) ; result = ExecCommand . exec ( createDomainImageScriptCmd . toString ( ) , true , additionalEnvMap ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; StringBuffer errorMsg = new StringBuffer ( "FAILURE: command: " ) ; errorMsg . append ( createDomainImageScriptCmd ) . append ( " failed, returned " ) . append ( result . stdout ( ) ) . append ( "\n" ) . append ( result . stderr ( ) ) ; fail ( errorMsg . toString ( ) , ex . getCause ( ) ) ; } }
Create a new or update an existing image using model in image.
Create a new or update an existing image using model in image .
// get domain base image, domain UID and domain name // Get the map of any additional environment vars, or null // create a new or update an existing image