new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItDomainInPV.java
private void createDomainOnPVUsingWdt(Path domainCreationScriptFile, Path modelFile,
                                        Path domainPropertiesFile, String domainUid,
                                        String pvName, String pvcName, String namespace) {
    logger.info("Preparing to run create domain job using WDT");

    List<Path> domainScriptFiles = new ArrayList<>();
    domainScriptFiles.add(domainCreationScriptFile);
    domainScriptFiles.add(domainPropertiesFile);
    domainScriptFiles.add(modelFile);

    logger.info("Creating a config map to hold domain creation scripts");
    String domainScriptConfigMapName = "create-domain-scripts-cm";
    assertDoesNotThrow(
        () -> createConfigMapForDomainCreation(
            domainScriptConfigMapName, domainScriptFiles, namespace, this.getClass().getSimpleName()),
        "Create configmap for domain creation failed");

    // create a V1Container with specific scripts and properties for creating domain
    V1Container jobCreationContainer = new V1Container()
        .addCommandItem("/bin/sh")
        .addArgsItem("/u01/weblogic/" + domainCreationScriptFile.getFileName()) //shell script to run WDT
        .addEnvItem(new V1EnvVar()
            .name("WDT_VERSION")
            .value(WDT_VERSION)) // WDT version to use
        .addEnvItem(new V1EnvVar()
            .name("WDT_MODEL_FILE")
            .value("/u01/weblogic/" + modelFile.getFileName())) // WDT model file
        .addEnvItem(new V1EnvVar()
            .name("WDT_VAR_FILE")
            .value("/u01/weblogic/" + domainPropertiesFile.getFileName())) // WDT model property file
        .addEnvItem(new V1EnvVar()
            .name("DOMAIN_HOME_DIR")
            .value("/shared/domains/" + domainUid)); // domain location

    logger.info("Running a Kubernetes job to create the domain");
    createDomainJob(image, isUseSecret, pvName, pvcName, domainScriptConfigMapName,
        namespace, jobCreationContainer);

  }
/**
   * Create a WebLogic domain on a persistent volume by doing the following.
   * Create a configmap containing WDT model file, property file and shell script to download and run WDT.
   * Create a Kubernetes job to create domain on persistent volume.
   *
   * @param domainCreationScriptFile path of the shell script to download and run WDT
   * @param modelFile path of the WDT model file
   * @param domainPropertiesFile property file holding properties referenced in WDT model file
   * @param domainUid unique id of the WebLogic domain
   * @param pvName name of the persistent volume to create domain in
   * @param pvcName name of the persistent volume claim
   * @param namespace name of the domain namespace in which the job is created
   */
Create a WebLogic domain on a persistent volume by doing the following.
Create a configmap containing WDT model file, property file and shell script to download and run WDT.
Create a Kubernetes job to create domain on persistent volume.


Create a WebLogic domain on a persistent volume by doing the following . Create a configmap containing WDT model file property file and shell script to download and run WDT . Create a Kubernetes job to create domain on persistent volume .
private void createDomainOnPVUsingWdt(Path domainCreationScriptFile, Path modelFile,
                                        Path domainPropertiesFile, String domainUid,
                                        String pvName, String pvcName, String namespace) {
    logger.info("Preparing to run create domain job using WDT");
    List<Path> domainScriptFiles = new ArrayList<>();
    domainScriptFiles.add(domainCreationScriptFile);
    domainScriptFiles.add(domainPropertiesFile);
    domainScriptFiles.add(modelFile);
    logger.info("Creating a config map to hold domain creation scripts");
    String domainScriptConfigMapName = "create-domain-scripts-cm";
    assertDoesNotThrow(
        () -> createConfigMapForDomainCreation(
            domainScriptConfigMapName, domainScriptFiles, namespace, this.getClass().getSimpleName()),
        "Create configmap for domain creation failed");
    V1Container jobCreationContainer = new V1Container()
        .addCommandItem("/bin/sh")
        .addArgsItem("/u01/weblogic/" + domainCreationScriptFile.getFileName()) 
        .addEnvItem(new V1EnvVar()
            .name("WDT_VERSION")
            .value(WDT_VERSION)) 
        .addEnvItem(new V1EnvVar()
            .name("WDT_MODEL_FILE")
            .value("/u01/weblogic/" + modelFile.getFileName())) 
        .addEnvItem(new V1EnvVar()
            .name("WDT_VAR_FILE")
            .value("/u01/weblogic/" + domainPropertiesFile.getFileName())) 
        .addEnvItem(new V1EnvVar()
            .name("DOMAIN_HOME_DIR")
            .value("/shared/domains/" + domainUid)); 
    logger.info("Running a Kubernetes job to create the domain");
    createDomainJob(image, isUseSecret, pvName, pvcName, domainScriptConfigMapName,
        namespace, jobCreationContainer);
  }
private void createDomainOnPVUsingWdt ( Path domainCreationScriptFile , Path modelFile , Path domainPropertiesFile , String domainUid , String pvName , String pvcName , String namespace ) { logger . info ( "Preparing to run create domain job using WDT" ) ; List < Path > domainScriptFiles = new ArrayList < > ( ) ; domainScriptFiles . add ( domainCreationScriptFile ) ; domainScriptFiles . add ( domainPropertiesFile ) ; domainScriptFiles . add ( modelFile ) ; logger . info ( "Creating a config map to hold domain creation scripts" ) ; String domainScriptConfigMapName = "create-domain-scripts-cm" ; assertDoesNotThrow ( ( ) -> createConfigMapForDomainCreation ( domainScriptConfigMapName , domainScriptFiles , namespace , this . getClass ( ) . getSimpleName ( ) ) , "Create configmap for domain creation failed" ) ; V1Container jobCreationContainer = new V1Container ( ) . addCommandItem ( "/bin/sh" ) . addArgsItem ( "/u01/weblogic/" + domainCreationScriptFile . getFileName ( ) ) . addEnvItem ( new V1EnvVar ( ) . name ( "WDT_VERSION" ) . value ( WDT_VERSION ) ) . addEnvItem ( new V1EnvVar ( ) . name ( "WDT_MODEL_FILE" ) . value ( "/u01/weblogic/" + modelFile . getFileName ( ) ) ) . addEnvItem ( new V1EnvVar ( ) . name ( "WDT_VAR_FILE" ) . value ( "/u01/weblogic/" + domainPropertiesFile . getFileName ( ) ) ) . addEnvItem ( new V1EnvVar ( ) . name ( "DOMAIN_HOME_DIR" ) . value ( "/shared/domains/" + domainUid ) ) ; logger . info ( "Running a Kubernetes job to create the domain" ) ; createDomainJob ( image , isUseSecret , pvName , pvcName , domainScriptConfigMapName , namespace , jobCreationContainer ) ; }
Create a WebLogic domain on a persistent volume by doing the following.
Create a WebLogic domain on a persistent volume by doing the following .
// create a V1Container with specific scripts and properties for creating domain //shell script to run WDT // WDT version to use // WDT model file // WDT model property file // domain location