Search in sources :

Example 1 with DockerConfiguration

use of org.jreleaser.model.DockerConfiguration in project jreleaser by jreleaser.

the class DockerValidator method isAlpineCompatible.

private static boolean isAlpineCompatible(Distribution distribution, DockerConfiguration docker) {
    List<Artifact> artifacts = distribution.getArtifacts().stream().filter(artifact -> artifact.getPath().endsWith(".zip")).collect(Collectors.toList());
    if (docker instanceof DockerSpec) {
        DockerSpec spec = (DockerSpec) docker;
        Optional<Artifact> artifact = artifacts.stream().filter(spec::matches).findFirst();
        if (artifact.isPresent()) {
            spec.setArtifact(artifact.get());
            return PlatformUtils.isAlpineLinux(artifact.get().getPlatform());
        }
        return false;
    }
    return artifacts.stream().anyMatch(artifact -> PlatformUtils.isAlpineLinux(artifact.getPlatform()));
}
Also used : Artifact(org.jreleaser.model.Artifact) DockerSpec(org.jreleaser.model.DockerSpec) DockerConfiguration(org.jreleaser.model.DockerConfiguration) LABEL_OCI_IMAGE_TITLE(org.jreleaser.model.Docker.LABEL_OCI_IMAGE_TITLE) StringUtils.isBlank(org.jreleaser.util.StringUtils.isBlank) JReleaserModel(org.jreleaser.model.JReleaserModel) LinkedHashMap(java.util.LinkedHashMap) Active(org.jreleaser.model.Active) Errors(org.jreleaser.util.Errors) Collections.singleton(java.util.Collections.singleton) LABEL_OCI_IMAGE_DESCRIPTION(org.jreleaser.model.Docker.LABEL_OCI_IMAGE_DESCRIPTION) Map(java.util.Map) JReleaserContext(org.jreleaser.model.JReleaserContext) Env(org.jreleaser.util.Env) DistributionsValidator.validateArtifactPlatforms(org.jreleaser.model.validation.DistributionsValidator.validateArtifactPlatforms) TemplateValidator.validateTemplate(org.jreleaser.model.validation.TemplateValidator.validateTemplate) Distribution(org.jreleaser.model.Distribution) LinkedHashSet(java.util.LinkedHashSet) LABEL_OCI_IMAGE_URL(org.jreleaser.model.Docker.LABEL_OCI_IMAGE_URL) LABEL_OCI_IMAGE_REVISION(org.jreleaser.model.Docker.LABEL_OCI_IMAGE_REVISION) LABEL_OCI_IMAGE_VERSION(org.jreleaser.model.Docker.LABEL_OCI_IMAGE_VERSION) Set(java.util.Set) PlatformUtils(org.jreleaser.util.PlatformUtils) Collectors(java.util.stream.Collectors) ExtraPropertiesValidator.mergeExtraProperties(org.jreleaser.model.validation.ExtraPropertiesValidator.mergeExtraProperties) Project(org.jreleaser.model.Project) List(java.util.List) Registry(org.jreleaser.model.Registry) LABEL_OCI_IMAGE_LICENSES(org.jreleaser.model.Docker.LABEL_OCI_IMAGE_LICENSES) Docker(org.jreleaser.model.Docker) Optional(java.util.Optional) GitService(org.jreleaser.model.GitService) RB(org.jreleaser.bundle.RB) Artifact(org.jreleaser.model.Artifact) DockerSpec(org.jreleaser.model.DockerSpec)

Aggregations

Collections.singleton (java.util.Collections.singleton)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 RB (org.jreleaser.bundle.RB)1 Active (org.jreleaser.model.Active)1 Artifact (org.jreleaser.model.Artifact)1 Distribution (org.jreleaser.model.Distribution)1 Docker (org.jreleaser.model.Docker)1 LABEL_OCI_IMAGE_DESCRIPTION (org.jreleaser.model.Docker.LABEL_OCI_IMAGE_DESCRIPTION)1 LABEL_OCI_IMAGE_LICENSES (org.jreleaser.model.Docker.LABEL_OCI_IMAGE_LICENSES)1 LABEL_OCI_IMAGE_REVISION (org.jreleaser.model.Docker.LABEL_OCI_IMAGE_REVISION)1 LABEL_OCI_IMAGE_TITLE (org.jreleaser.model.Docker.LABEL_OCI_IMAGE_TITLE)1 LABEL_OCI_IMAGE_URL (org.jreleaser.model.Docker.LABEL_OCI_IMAGE_URL)1 LABEL_OCI_IMAGE_VERSION (org.jreleaser.model.Docker.LABEL_OCI_IMAGE_VERSION)1 DockerConfiguration (org.jreleaser.model.DockerConfiguration)1