Search in sources :

Example 16 with InvalidImageReferenceException

use of com.google.cloud.tools.jib.api.InvalidImageReferenceException in project jib by google.

the class BuildTarTask method buildTar.

/**
 * Task Action, builds an image to tar file.
 *
 * @throws IOException if an error occurs creating the jib runner
 * @throws BuildStepsExecutionException if an error occurs while executing build steps
 * @throws CacheDirectoryCreationException if a new cache directory could not be created
 * @throws MainClassInferenceException if a main class could not be found
 * @throws InvalidGlobalConfigException if the global config file is invalid
 */
@TaskAction
public void buildTar() throws BuildStepsExecutionException, IOException, CacheDirectoryCreationException, MainClassInferenceException, InvalidGlobalConfigException {
    // Asserts required @Input parameters are not null.
    Preconditions.checkNotNull(jibExtension);
    TaskCommon.disableHttpLogging();
    TempDirectoryProvider tempDirectoryProvider = new TempDirectoryProvider();
    GradleProjectProperties projectProperties = GradleProjectProperties.getForProject(getProject(), getLogger(), tempDirectoryProvider, jibExtension.getConfigurationName().get());
    GlobalConfig globalConfig = GlobalConfig.readConfig();
    Future<Optional<String>> updateCheckFuture = TaskCommon.newUpdateChecker(projectProperties, globalConfig, getLogger());
    try {
        PluginConfigurationProcessor.createJibBuildRunnerForTarImage(new GradleRawConfiguration(jibExtension), ignored -> Optional.empty(), projectProperties, globalConfig, new GradleHelpfulSuggestions(HELPFUL_SUGGESTIONS_PREFIX)).runBuild();
    } catch (InvalidAppRootException ex) {
        throw new GradleException("container.appRoot is not an absolute Unix-style path: " + ex.getInvalidPathValue(), ex);
    } catch (InvalidContainerizingModeException ex) {
        throw new GradleException("invalid value for containerizingMode: " + ex.getInvalidContainerizingMode(), ex);
    } catch (InvalidWorkingDirectoryException ex) {
        throw new GradleException("container.workingDirectory is not an absolute Unix-style path: " + ex.getInvalidPathValue(), ex);
    } catch (InvalidPlatformException ex) {
        throw new GradleException("from.platforms contains a platform configuration that is missing required values or has invalid values: " + ex.getMessage() + ": " + ex.getInvalidPlatform(), ex);
    } catch (InvalidContainerVolumeException ex) {
        throw new GradleException("container.volumes is not an absolute Unix-style path: " + ex.getInvalidVolume(), ex);
    } catch (InvalidFilesModificationTimeException ex) {
        throw new GradleException("container.filesModificationTime should be an ISO 8601 date-time (see " + "DateTimeFormatter.ISO_DATE_TIME) or special keyword \"EPOCH_PLUS_SECOND\": " + ex.getInvalidFilesModificationTime(), ex);
    } catch (InvalidCreationTimeException ex) {
        throw new GradleException("container.creationTime should be an ISO 8601 date-time (see " + "DateTimeFormatter.ISO_DATE_TIME) or a special keyword (\"EPOCH\", " + "\"USE_CURRENT_TIMESTAMP\"): " + ex.getInvalidCreationTime(), ex);
    } catch (JibPluginExtensionException ex) {
        String extensionName = ex.getExtensionClass().getName();
        throw new GradleException("error running extension '" + extensionName + "': " + ex.getMessage(), ex);
    } catch (IncompatibleBaseImageJavaVersionException ex) {
        throw new GradleException(HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForGradle(ex.getBaseImageMajorJavaVersion(), ex.getProjectMajorJavaVersion()), ex);
    } catch (InvalidImageReferenceException ex) {
        throw new GradleException(HelpfulSuggestions.forInvalidImageReference(ex.getInvalidReference()), ex);
    } catch (ExtraDirectoryNotFoundException ex) {
        throw new GradleException("extraDirectories.paths contain \"from\" directory that doesn't exist locally: " + ex.getPath(), ex);
    } finally {
        tempDirectoryProvider.close();
        TaskCommon.finishUpdateChecker(projectProperties, updateCheckFuture);
        projectProperties.waitForLoggingThread();
    }
}
Also used : BuildStepsExecutionException(com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException) InvalidAppRootException(com.google.cloud.tools.jib.plugins.common.InvalidAppRootException) MainClassInferenceException(com.google.cloud.tools.jib.plugins.common.MainClassInferenceException) JibPluginExtensionException(com.google.cloud.tools.jib.plugins.extension.JibPluginExtensionException) FileCollection(org.gradle.api.file.FileCollection) InputFiles(org.gradle.api.tasks.InputFiles) InvalidPlatformException(com.google.cloud.tools.jib.plugins.common.InvalidPlatformException) TaskAction(org.gradle.api.tasks.TaskAction) InvalidContainerizingModeException(com.google.cloud.tools.jib.plugins.common.InvalidContainerizingModeException) Future(java.util.concurrent.Future) CacheDirectoryCreationException(com.google.cloud.tools.jib.api.CacheDirectoryCreationException) DefaultTask(org.gradle.api.DefaultTask) Path(java.nio.file.Path) TempDirectoryProvider(com.google.cloud.tools.jib.filesystem.TempDirectoryProvider) Nullable(javax.annotation.Nullable) InvalidGlobalConfigException(com.google.cloud.tools.jib.plugins.common.globalconfig.InvalidGlobalConfigException) ExtraDirectoryNotFoundException(com.google.cloud.tools.jib.plugins.common.ExtraDirectoryNotFoundException) PluginConfigurationProcessor(com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor) GlobalConfig(com.google.cloud.tools.jib.plugins.common.globalconfig.GlobalConfig) HelpfulSuggestions(com.google.cloud.tools.jib.plugins.common.HelpfulSuggestions) IOException(java.io.IOException) InvalidImageReferenceException(com.google.cloud.tools.jib.api.InvalidImageReferenceException) Collectors(java.util.stream.Collectors) List(java.util.List) OutputFile(org.gradle.api.tasks.OutputFile) GradleException(org.gradle.api.GradleException) InvalidWorkingDirectoryException(com.google.cloud.tools.jib.plugins.common.InvalidWorkingDirectoryException) Optional(java.util.Optional) Option(org.gradle.api.tasks.options.Option) InvalidContainerVolumeException(com.google.cloud.tools.jib.plugins.common.InvalidContainerVolumeException) Preconditions(com.google.common.base.Preconditions) Nested(org.gradle.api.tasks.Nested) InvalidFilesModificationTimeException(com.google.cloud.tools.jib.plugins.common.InvalidFilesModificationTimeException) IncompatibleBaseImageJavaVersionException(com.google.cloud.tools.jib.plugins.common.IncompatibleBaseImageJavaVersionException) InvalidCreationTimeException(com.google.cloud.tools.jib.plugins.common.InvalidCreationTimeException) InvalidAppRootException(com.google.cloud.tools.jib.plugins.common.InvalidAppRootException) Optional(java.util.Optional) InvalidContainerVolumeException(com.google.cloud.tools.jib.plugins.common.InvalidContainerVolumeException) GlobalConfig(com.google.cloud.tools.jib.plugins.common.globalconfig.GlobalConfig) InvalidImageReferenceException(com.google.cloud.tools.jib.api.InvalidImageReferenceException) ExtraDirectoryNotFoundException(com.google.cloud.tools.jib.plugins.common.ExtraDirectoryNotFoundException) InvalidFilesModificationTimeException(com.google.cloud.tools.jib.plugins.common.InvalidFilesModificationTimeException) IncompatibleBaseImageJavaVersionException(com.google.cloud.tools.jib.plugins.common.IncompatibleBaseImageJavaVersionException) JibPluginExtensionException(com.google.cloud.tools.jib.plugins.extension.JibPluginExtensionException) GradleException(org.gradle.api.GradleException) InvalidWorkingDirectoryException(com.google.cloud.tools.jib.plugins.common.InvalidWorkingDirectoryException) TempDirectoryProvider(com.google.cloud.tools.jib.filesystem.TempDirectoryProvider) InvalidContainerizingModeException(com.google.cloud.tools.jib.plugins.common.InvalidContainerizingModeException) InvalidPlatformException(com.google.cloud.tools.jib.plugins.common.InvalidPlatformException) InvalidCreationTimeException(com.google.cloud.tools.jib.plugins.common.InvalidCreationTimeException) TaskAction(org.gradle.api.tasks.TaskAction)

Example 17 with InvalidImageReferenceException

use of com.google.cloud.tools.jib.api.InvalidImageReferenceException in project docker-maven-plugin by fabric8io.

the class JibServiceUtil method pushImage.

private static void pushImage(TarImage baseImage, String targetImageName, Credential credential, Logger logger) throws InterruptedException {
    final ExecutorService jibBuildExecutor = Executors.newCachedThreadPool();
    try {
        submitPushToJib(baseImage, getRegistryImage(targetImageName, credential), jibBuildExecutor, logger);
    } catch (RegistryException | CacheDirectoryCreationException | InvalidImageReferenceException | IOException | ExecutionException e) {
        logger.error("Exception occurred while pushing the image: %s, %s", targetImageName, e.getMessage());
        throw new IllegalStateException(e.getMessage(), e);
    } catch (InterruptedException ex) {
        logger.error("Thread interrupted", ex);
        throw ex;
    } finally {
        jibBuildExecutor.shutdown();
        jibBuildExecutor.awaitTermination(JIB_EXECUTOR_SHUTDOWN_TIMEOUT_SECONDS, TimeUnit.SECONDS);
    }
}
Also used : CacheDirectoryCreationException(com.google.cloud.tools.jib.api.CacheDirectoryCreationException) ExecutorService(java.util.concurrent.ExecutorService) InvalidImageReferenceException(com.google.cloud.tools.jib.api.InvalidImageReferenceException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) RegistryException(com.google.cloud.tools.jib.api.RegistryException)

Example 18 with InvalidImageReferenceException

use of com.google.cloud.tools.jib.api.InvalidImageReferenceException in project fabric8-maven-plugin by fabric8io.

the class JibServiceUtil method containerFromImageConfiguration.

static JibContainerBuilder containerFromImageConfiguration(ImageConfiguration imageConfiguration) throws InvalidImageReferenceException {
    final Optional<BuildImageConfiguration> bic = Optional.ofNullable(Objects.requireNonNull(imageConfiguration).getBuildConfiguration());
    final JibContainerBuilder containerBuilder = Jib.from(getBaseImage(imageConfiguration)).setFormat(ImageFormat.OCI);
    bic.map(BuildImageConfiguration::getEntryPoint).map(Arguments::asStrings).ifPresent(containerBuilder::setEntrypoint);
    bic.map(BuildImageConfiguration::getEnv).ifPresent(containerBuilder::setEnvironment);
    bic.map(BuildImageConfiguration::getPorts).map(List::stream).map(s -> s.map(Integer::parseInt).map(Port::tcp)).map(s -> s.collect(Collectors.toSet())).ifPresent(containerBuilder::setExposedPorts);
    bic.map(BuildImageConfiguration::getLabels).map(Map::entrySet).ifPresent(labels -> labels.forEach(l -> containerBuilder.addLabel(l.getKey(), l.getValue())));
    bic.map(BuildImageConfiguration::getCmd).map(Arguments::asStrings).ifPresent(containerBuilder::setProgramArguments);
    bic.map(BuildImageConfiguration::getUser).ifPresent(containerBuilder::setUser);
    bic.map(BuildImageConfiguration::getVolumes).map(List::stream).map(s -> s.map(AbsoluteUnixPath::get)).map(s -> s.collect(Collectors.toSet())).ifPresent(containerBuilder::setVolumes);
    bic.map(BuildImageConfiguration::getWorkdir).filter(((Predicate<String>) String::isEmpty).negate()).map(AbsoluteUnixPath::get).ifPresent(containerBuilder::setWorkingDirectory);
    return containerBuilder;
}
Also used : ImageReference(com.google.cloud.tools.jib.api.ImageReference) BuildImageConfiguration(io.fabric8.maven.docker.config.BuildImageConfiguration) JibContainerBuilder(com.google.cloud.tools.jib.api.JibContainerBuilder) ImageName(io.fabric8.maven.docker.util.ImageName) ImageConfiguration(io.fabric8.maven.docker.config.ImageConfiguration) Logger(io.fabric8.maven.docker.util.Logger) RegistryImage(com.google.cloud.tools.jib.api.RegistryImage) ProgressEvent(com.google.cloud.tools.jib.event.events.ProgressEvent) Credential(com.google.cloud.tools.jib.api.Credential) HashSet(java.util.HashSet) Jib(com.google.cloud.tools.jib.api.Jib) TimerEventHandler(com.google.cloud.tools.jib.plugins.common.TimerEventHandler) CacheDirectoryCreationException(com.google.cloud.tools.jib.api.CacheDirectoryCreationException) MavenProject(org.apache.maven.project.MavenProject) Map(java.util.Map) Port(com.google.cloud.tools.jib.api.Port) AbsoluteUnixPath(com.google.cloud.tools.jib.api.AbsoluteUnixPath) AuthConfig(io.fabric8.maven.docker.access.AuthConfig) ExecutorService(java.util.concurrent.ExecutorService) Ansi.ansi(org.fusesource.jansi.Ansi.ansi) StringUtils(org.codehaus.plexus.util.StringUtils) Predicate(java.util.function.Predicate) Set(java.util.Set) TarImage(com.google.cloud.tools.jib.api.TarImage) IOException(java.io.IOException) TimerEvent(com.google.cloud.tools.jib.event.events.TimerEvent) InvalidImageReferenceException(com.google.cloud.tools.jib.api.InvalidImageReferenceException) RegistryException(com.google.cloud.tools.jib.api.RegistryException) ProgressEventHandler(com.google.cloud.tools.jib.event.progress.ProgressEventHandler) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) File(java.io.File) Executors(java.util.concurrent.Executors) Objects(java.util.Objects) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) LogEvent(com.google.cloud.tools.jib.api.LogEvent) List(java.util.List) Containerizer(com.google.cloud.tools.jib.api.Containerizer) ImageFormat(com.google.cloud.tools.jib.api.ImageFormat) RegistryService(io.fabric8.maven.docker.service.RegistryService) Paths(java.nio.file.Paths) EnvUtil(io.fabric8.maven.docker.util.EnvUtil) ProgressDisplayGenerator(com.google.cloud.tools.jib.plugins.common.logging.ProgressDisplayGenerator) Arguments(io.fabric8.maven.docker.config.Arguments) Optional(java.util.Optional) JibContainerBuilder(com.google.cloud.tools.jib.api.JibContainerBuilder) BuildImageConfiguration(io.fabric8.maven.docker.config.BuildImageConfiguration)

Example 19 with InvalidImageReferenceException

use of com.google.cloud.tools.jib.api.InvalidImageReferenceException in project jib by google.

the class PluginConfigurationProcessorTest method testEntrypoint_extraClasspathNonWarPackaging.

@Test
public void testEntrypoint_extraClasspathNonWarPackaging() throws IOException, InvalidImageReferenceException, MainClassInferenceException, InvalidAppRootException, InvalidWorkingDirectoryException, InvalidPlatformException, InvalidContainerVolumeException, IncompatibleBaseImageJavaVersionException, NumberFormatException, InvalidContainerizingModeException, InvalidFilesModificationTimeException, InvalidCreationTimeException, ExtraDirectoryNotFoundException {
    when(rawConfiguration.getExtraClasspath()).thenReturn(Collections.singletonList("/foo"));
    when(projectProperties.isWarProject()).thenReturn(false);
    ContainerBuildPlan buildPlan = processCommonConfiguration();
    assertThat(buildPlan.getEntrypoint()).containsExactly("java", "-cp", "/foo:/app/resources:/app/classes:/app/libs/*", "java.lang.Object").inOrder();
    ArgumentMatcher<LogEvent> isLogWarn = logEvent -> logEvent.getLevel() == LogEvent.Level.WARN;
    verify(logger, never()).accept(argThat(isLogWarn));
}
Also used : CredHelperConfiguration(com.google.cloud.tools.jib.plugins.common.RawConfiguration.CredHelperConfiguration) Arrays(java.util.Arrays) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) URISyntaxException(java.net.URISyntaxException) FileTime(java.nio.file.attribute.FileTime) PlatformConfiguration(com.google.cloud.tools.jib.plugins.common.RawConfiguration.PlatformConfiguration) JavaContainerBuilder(com.google.cloud.tools.jib.api.JavaContainerBuilder) ExtraDirectoriesConfiguration(com.google.cloud.tools.jib.plugins.common.RawConfiguration.ExtraDirectoriesConfiguration) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) ArgumentMatcher(org.mockito.ArgumentMatcher) JUnitParamsRunner(junitparams.JUnitParamsRunner) Path(java.nio.file.Path) AbsoluteUnixPath(com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) JibContainerBuilderTestHelper(com.google.cloud.tools.jib.api.JibContainerBuilderTestHelper) FilePermissions(com.google.cloud.tools.jib.api.buildplan.FilePermissions) InvalidImageReferenceException(com.google.cloud.tools.jib.api.InvalidImageReferenceException) Instant(java.time.Instant) StandardCharsets(java.nio.charset.StandardCharsets) List(java.util.List) FileEntry(com.google.cloud.tools.jib.api.buildplan.FileEntry) Optional(java.util.Optional) ContainerBuildPlan(com.google.cloud.tools.jib.api.buildplan.ContainerBuildPlan) Platform(com.google.cloud.tools.jib.api.buildplan.Platform) Parameters(junitparams.Parameters) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) JibContainerBuilder(com.google.cloud.tools.jib.api.JibContainerBuilder) ImageConfiguration(com.google.cloud.tools.jib.configuration.ImageConfiguration) Mock(org.mockito.Mock) Assert.assertThrows(org.junit.Assert.assertThrows) RegistryImage(com.google.cloud.tools.jib.api.RegistryImage) RunWith(org.junit.runner.RunWith) FileEntriesLayer(com.google.cloud.tools.jib.api.buildplan.FileEntriesLayer) Jib(com.google.cloud.tools.jib.api.Jib) CacheDirectoryCreationException(com.google.cloud.tools.jib.api.CacheDirectoryCreationException) ImmutableList(com.google.common.collect.ImmutableList) MockitoJUnit(org.mockito.junit.MockitoJUnit) Truth8.assertThat(com.google.common.truth.Truth8.assertThat) Nullable(javax.annotation.Nullable) Before(org.junit.Before) Answers(org.mockito.Answers) Resources(com.google.common.io.Resources) Files(java.nio.file.Files) IOException(java.io.IOException) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Truth.assertThat(com.google.common.truth.Truth.assertThat) ModificationTimeProvider(com.google.cloud.tools.jib.api.buildplan.ModificationTimeProvider) File(java.io.File) Mockito.verify(org.mockito.Mockito.verify) Correspondence(com.google.common.truth.Correspondence) Consumer(java.util.function.Consumer) LogEvent(com.google.cloud.tools.jib.api.LogEvent) Mockito(org.mockito.Mockito) Mockito.never(org.mockito.Mockito.never) Rule(org.junit.Rule) Containerizer(com.google.cloud.tools.jib.api.Containerizer) Paths(java.nio.file.Paths) DateTimeFormatter(java.time.format.DateTimeFormatter) RestoreSystemProperties(org.junit.contrib.java.lang.system.RestoreSystemProperties) MockitoRule(org.mockito.junit.MockitoRule) Collections(java.util.Collections) TemporaryFolder(org.junit.rules.TemporaryFolder) LogEvent(com.google.cloud.tools.jib.api.LogEvent) ContainerBuildPlan(com.google.cloud.tools.jib.api.buildplan.ContainerBuildPlan) Test(org.junit.Test)

Example 20 with InvalidImageReferenceException

use of com.google.cloud.tools.jib.api.InvalidImageReferenceException in project jib by google.

the class PluginConfigurationProcessorTest method testPluginConfigurationProcessor_extraDirectory.

@Test
public void testPluginConfigurationProcessor_extraDirectory() throws URISyntaxException, InvalidContainerVolumeException, MainClassInferenceException, InvalidAppRootException, IOException, IncompatibleBaseImageJavaVersionException, InvalidWorkingDirectoryException, InvalidPlatformException, InvalidImageReferenceException, NumberFormatException, InvalidContainerizingModeException, InvalidFilesModificationTimeException, InvalidCreationTimeException, ExtraDirectoryNotFoundException {
    Path extraDirectory = Paths.get(Resources.getResource("core/layer").toURI());
    Mockito.<List<?>>when(rawConfiguration.getExtraDirectories()).thenReturn(Arrays.asList(new TestExtraDirectoriesConfiguration(extraDirectory)));
    when(rawConfiguration.getExtraDirectoryPermissions()).thenReturn(ImmutableMap.of("/target/dir/foo", FilePermissions.fromOctalString("123")));
    ContainerBuildPlan buildPlan = processCommonConfiguration();
    List<FileEntry> extraFiles = getLayerEntries(buildPlan, "extra files");
    assertThat(extraFiles).comparingElementsUsing(SOURCE_FILE_OF).containsExactly(extraDirectory.resolve("a"), extraDirectory.resolve("a/b"), extraDirectory.resolve("a/b/bar"), extraDirectory.resolve("c"), extraDirectory.resolve("c/cat"), extraDirectory.resolve("foo"));
    assertThat(extraFiles).comparingElementsUsing(EXTRACTION_PATH_OF).containsExactly("/target/dir/a", "/target/dir/a/b", "/target/dir/a/b/bar", "/target/dir/c", "/target/dir/c/cat", "/target/dir/foo");
    Optional<FileEntry> fooEntry = extraFiles.stream().filter(layerEntry -> layerEntry.getExtractionPath().equals(AbsoluteUnixPath.get("/target/dir/foo"))).findFirst();
    assertThat(fooEntry).isPresent();
    assertThat(fooEntry.get().getPermissions().toOctalString()).isEqualTo("123");
}
Also used : Path(java.nio.file.Path) AbsoluteUnixPath(com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath) CredHelperConfiguration(com.google.cloud.tools.jib.plugins.common.RawConfiguration.CredHelperConfiguration) Arrays(java.util.Arrays) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) URISyntaxException(java.net.URISyntaxException) FileTime(java.nio.file.attribute.FileTime) PlatformConfiguration(com.google.cloud.tools.jib.plugins.common.RawConfiguration.PlatformConfiguration) JavaContainerBuilder(com.google.cloud.tools.jib.api.JavaContainerBuilder) ExtraDirectoriesConfiguration(com.google.cloud.tools.jib.plugins.common.RawConfiguration.ExtraDirectoriesConfiguration) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) ArgumentMatcher(org.mockito.ArgumentMatcher) JUnitParamsRunner(junitparams.JUnitParamsRunner) Path(java.nio.file.Path) AbsoluteUnixPath(com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) JibContainerBuilderTestHelper(com.google.cloud.tools.jib.api.JibContainerBuilderTestHelper) FilePermissions(com.google.cloud.tools.jib.api.buildplan.FilePermissions) InvalidImageReferenceException(com.google.cloud.tools.jib.api.InvalidImageReferenceException) Instant(java.time.Instant) StandardCharsets(java.nio.charset.StandardCharsets) List(java.util.List) FileEntry(com.google.cloud.tools.jib.api.buildplan.FileEntry) Optional(java.util.Optional) ContainerBuildPlan(com.google.cloud.tools.jib.api.buildplan.ContainerBuildPlan) Platform(com.google.cloud.tools.jib.api.buildplan.Platform) Parameters(junitparams.Parameters) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) JibContainerBuilder(com.google.cloud.tools.jib.api.JibContainerBuilder) ImageConfiguration(com.google.cloud.tools.jib.configuration.ImageConfiguration) Mock(org.mockito.Mock) Assert.assertThrows(org.junit.Assert.assertThrows) RegistryImage(com.google.cloud.tools.jib.api.RegistryImage) RunWith(org.junit.runner.RunWith) FileEntriesLayer(com.google.cloud.tools.jib.api.buildplan.FileEntriesLayer) Jib(com.google.cloud.tools.jib.api.Jib) CacheDirectoryCreationException(com.google.cloud.tools.jib.api.CacheDirectoryCreationException) ImmutableList(com.google.common.collect.ImmutableList) MockitoJUnit(org.mockito.junit.MockitoJUnit) Truth8.assertThat(com.google.common.truth.Truth8.assertThat) Nullable(javax.annotation.Nullable) Before(org.junit.Before) Answers(org.mockito.Answers) Resources(com.google.common.io.Resources) Files(java.nio.file.Files) IOException(java.io.IOException) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Truth.assertThat(com.google.common.truth.Truth.assertThat) ModificationTimeProvider(com.google.cloud.tools.jib.api.buildplan.ModificationTimeProvider) File(java.io.File) Mockito.verify(org.mockito.Mockito.verify) Correspondence(com.google.common.truth.Correspondence) Consumer(java.util.function.Consumer) LogEvent(com.google.cloud.tools.jib.api.LogEvent) Mockito(org.mockito.Mockito) Mockito.never(org.mockito.Mockito.never) Rule(org.junit.Rule) Containerizer(com.google.cloud.tools.jib.api.Containerizer) Paths(java.nio.file.Paths) DateTimeFormatter(java.time.format.DateTimeFormatter) RestoreSystemProperties(org.junit.contrib.java.lang.system.RestoreSystemProperties) MockitoRule(org.mockito.junit.MockitoRule) Collections(java.util.Collections) TemporaryFolder(org.junit.rules.TemporaryFolder) FileEntry(com.google.cloud.tools.jib.api.buildplan.FileEntry) ContainerBuildPlan(com.google.cloud.tools.jib.api.buildplan.ContainerBuildPlan) Test(org.junit.Test)

Aggregations

InvalidImageReferenceException (com.google.cloud.tools.jib.api.InvalidImageReferenceException)45 IOException (java.io.IOException)33 CacheDirectoryCreationException (com.google.cloud.tools.jib.api.CacheDirectoryCreationException)25 Optional (java.util.Optional)24 Path (java.nio.file.Path)19 JibContainerBuilder (com.google.cloud.tools.jib.api.JibContainerBuilder)18 JibPluginExtensionException (com.google.cloud.tools.jib.plugins.extension.JibPluginExtensionException)18 RegistryImage (com.google.cloud.tools.jib.api.RegistryImage)17 Paths (java.nio.file.Paths)16 List (java.util.List)16 Nullable (javax.annotation.Nullable)16 Containerizer (com.google.cloud.tools.jib.api.Containerizer)15 LogEvent (com.google.cloud.tools.jib.api.LogEvent)15 Jib (com.google.cloud.tools.jib.api.Jib)14 AbsoluteUnixPath (com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath)14 GlobalConfig (com.google.cloud.tools.jib.plugins.common.globalconfig.GlobalConfig)14 FileEntriesLayer (com.google.cloud.tools.jib.api.buildplan.FileEntriesLayer)13 Instant (java.time.Instant)13 ContainerBuildPlan (com.google.cloud.tools.jib.api.buildplan.ContainerBuildPlan)12 Platform (com.google.cloud.tools.jib.api.buildplan.Platform)12