new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMonitoringExporter.java
public static String createPushImage(String dockerFileDir, String baseImageName,
                                                    String namespace, String secretName) throws ApiException {
    // create unique image name with date
    final String imageTag = TestUtils.getDateAndTimeStamp();
    // Add repository name in image name for Jenkins runs
    final String imageName = REPO_NAME + baseImageName;

    final String image = imageName + ":" + imageTag;

    //build image
    assertTrue(Docker.createImage(dockerFileDir, image), "Failed to create image " + baseImageName);
    logger.info("image is created with name {0}", image);
    if (!new Namespace().exists(namespace)) {
      createNamespace(namespace);
    }

    //create registry docker secret
    createDockerRegistrySecret(REPO_USERNAME, REPO_PASSWORD, REPO_EMAIL,
        REPO_REGISTRY, secretName, namespace);
    // docker login and push image to docker registry if necessary
    dockerLoginAndPushImageToRegistry(image);

    return image;
  }
/**
   * Build image with unique name, create corresponding docker secret and push to registry.
   *
   * @param dockerFileDir directory where dockerfile is located
   * @param baseImageName base image name
   * @param namespace image namespace
   * @param secretName docker secretname for image
   * @return image name
   */
Build image with unique name, create corresponding docker secret and push to registry.
Build image with unique name create corresponding docker secret and push to registry .
public static String createPushImage(String dockerFileDir, String baseImageName,
                                                    String namespace, String secretName) throws ApiException {
    final String imageTag = TestUtils.getDateAndTimeStamp();
    final String imageName = REPO_NAME + baseImageName;
    final String image = imageName + ":" + imageTag;
    assertTrue(Docker.createImage(dockerFileDir, image), "Failed to create image " + baseImageName);
    logger.info("image is created with name {0}", image);
    if (!new Namespace().exists(namespace)) {
      createNamespace(namespace);
    }
    createDockerRegistrySecret(REPO_USERNAME, REPO_PASSWORD, REPO_EMAIL,
        REPO_REGISTRY, secretName, namespace);
    dockerLoginAndPushImageToRegistry(image);
    return image;
  }
public static String createPushImage ( String dockerFileDir , String baseImageName , String namespace , String secretName ) throws ApiException { final String imageTag = TestUtils . getDateAndTimeStamp ( ) ; final String imageName = REPO_NAME + baseImageName ; final String image = imageName + ":" + imageTag ; assertTrue ( Docker . createImage ( dockerFileDir , image ) , "Failed to create image " + baseImageName ) ; logger . info ( "image is created with name {0}" , image ) ; if ( ! new Namespace ( ) . exists ( namespace ) ) { createNamespace ( namespace ) ; } createDockerRegistrySecret ( REPO_USERNAME , REPO_PASSWORD , REPO_EMAIL , REPO_REGISTRY , secretName , namespace ) ; dockerLoginAndPushImageToRegistry ( image ) ; return image ; }
Build image with unique name, create corresponding docker secret and push to registry.
Build image with unique name create corresponding docker secret and push to registry .
// create unique image name with date // Add repository name in image name for Jenkins runs //build image //create registry docker secret // docker login and push image to docker registry if necessary