Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.Objects;

import org.apache.camel.test.infra.cli.common.CliProperties;
import org.apache.camel.test.infra.common.LocalPropertyResolver;
import org.apache.camel.test.infra.common.TestUtils;
import org.junit.platform.commons.util.StringUtils;
import org.slf4j.Logger;
Expand All @@ -48,9 +49,6 @@ public class CliBuiltContainer extends GenericContainer<CliBuiltContainer> {
private static final String KEEP_RUNNING_ARG = "KEEP_RUNNING";
private static final String MOUNT_POINT = "/deployments/data";
private static final String SSH_PASSWORD_ARG = "SSH_PASSWORD_ARG";
// NOTE: make sure to run integration tests locally when changing in order to
// validate potential breaking changes compatibility when building the container
private static final String FROM_IMAGE_NAME = "mirror.gcr.io/fedora:43";
private static final String FROM_IMAGE_ARG = "FROMIMAGE";
protected static final int DEV_CONSOLE_PORT = 8080;
protected static final int SSH_PORT = 22;
Expand Down Expand Up @@ -87,7 +85,7 @@ public CliBuiltContainer(CliBuiltContainerParams params) {
.withFileFromClasspath("99-ssh-jbang.conf",
"org/apache/camel/test/infra/cli/services/99-ssh-jbang.conf")
.withBuildArg(FROM_IMAGE_ARG, TestUtils.prependHubImageNamePrefixIfNeeded(
System.getProperty(CliProperties.FROM_IMAGE, FROM_IMAGE_NAME)))
LocalPropertyResolver.getProperty(CliBuiltContainer.class, CliProperties.FROM_IMAGE)))
.withBuildArg(CAMEL_REF_ARG, params.getCamelRef())
.withBuildArg(KEEP_RUNNING_ARG, String.valueOf(params.getKeepContainerRunning()))
.withBuildArg(SSH_PASSWORD_ARG, params.getSshPassword())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#

ARG FROMIMAGE
ARG FROMIMAGE=mirror.gcr.io/fedora:43

FROM $FROMIMAGE

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## ---------------------------------------------------------------------------
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
#
# NOTE: make sure to run integration tests locally when changing in order to
# validate potential breaking changes compatibility when building the container
cli.service.from.image=mirror.gcr.io/fedora:43
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public final class HiveMQProperties {
public static final String HIVEMQ_CONTAINER = "hivemq.container";
public static final String HIVEMQ_RESOURCE_PATH = "hivemq.resource.path";
public static final String HIVEMQ_SPARKPLUG_CONTAINER = "hivemq.sparkplug.container";
public static final String HIVEMQ_SPARKPLUG_FROM_IMAGE = "hivemq.sparkplug.from.image";
public static final String HIVEMQ_SPARKPLUG_INSTANCE_SELECTOR = "hivemq-sparkplug";

public static final String HIVEMQ_TEST_SERVICE_NAME = "hivemq";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.apache.camel.spi.annotations.InfraService;
import org.apache.camel.test.infra.common.LocalPropertyResolver;
import org.apache.camel.test.infra.common.TestUtils;
import org.apache.camel.test.infra.common.services.ContainerEnvironmentUtil;
import org.apache.camel.test.infra.hivemq.common.HiveMQProperties;
import org.testcontainers.hivemq.HiveMQContainer;
Expand All @@ -40,8 +41,14 @@ protected HiveMQContainer initContainer(String imageName) {
String dockerfileResourcePath = LocalPropertyResolver.getProperty(LocalHiveMQSparkplugTCKInfraService.class,
HiveMQProperties.HIVEMQ_RESOURCE_PATH);

String fromImage = TestUtils.prependHubImageNamePrefixIfNeeded(
LocalPropertyResolver.getProperty(
LocalHiveMQSparkplugTCKInfraService.class, HiveMQProperties.HIVEMQ_SPARKPLUG_FROM_IMAGE));

ImageFromDockerfile newImage
= new ImageFromDockerfile(imageName, false).withFileFromClasspath(".", dockerfileResourcePath);
= new ImageFromDockerfile(imageName, false)
.withFileFromClasspath(".", dockerfileResourcePath)
.withBuildArg("FROMIMAGE", fromImage);
String newImageName = newImage.get();

class TestInfraHiveMQContainer extends HiveMQContainer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# limitations under the License.
#

ARG HIVEMQ_VERSION=2024.6
ARG FROMIMAGE=mirror.gcr.io/hivemq/hivemq-ce:2024.6

FROM mirror.gcr.io/hivemq/hivemq-ce:$HIVEMQ_VERSION as hivemq-ce-sparkplug-tck
FROM $FROMIMAGE as hivemq-ce-sparkplug-tck

ARG SPARKPLUG_TCK_VERSION=3.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
## ---------------------------------------------------------------------------
hivemq.container=mirror.gcr.io/hivemq/hivemq-ce:2025.5
hivemq.resource.path=org/apache/camel/test/infra/hivemq/services
hivemq.sparkplug.container=localhost/hivemq-ce-sparkplug-tck:camel
hivemq.sparkplug.container=localhost/hivemq-ce-sparkplug-tck:camel
hivemq.sparkplug.from.image=mirror.gcr.io/hivemq/hivemq-ce:2024.6
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ public class SmbProperties {
public static final String SHARE_NAME = "smb.service.share";
public static final String SMB_USERNAME = "smb.service.username";
public static final String SMB_PASSWORD = "smb.service.password";
public static final String SMB_FROM_IMAGE = "smb.service.from.image";

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@

import java.nio.file.Path;

import org.apache.camel.test.infra.common.LocalPropertyResolver;
import org.apache.camel.test.infra.common.TestUtils;
import org.apache.camel.test.infra.common.services.ContainerEnvironmentUtil;
import org.apache.camel.test.infra.smb.common.SmbProperties;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.images.builder.ImageFromDockerfile;
Expand All @@ -31,6 +34,7 @@ public class SmbContainer extends GenericContainer<SmbContainer> {
public static final String DEFAULT_USER = "camel";
// NOTE: default value used for testing purposes only.
public static final String DEFAULT_PASSWORD = "camelTester123"; // NOSONAR
private static final String FROM_IMAGE_ARG = "FROMIMAGE";

public SmbContainer(boolean fixedPort) {
super(new ImageFromDockerfile("localhost/samba:camel", false)
Expand All @@ -41,7 +45,10 @@ public SmbContainer(boolean fixedPort) {
.withFileFromClasspath("smb.conf",
"org/apache/camel/test/infra/smb/services/smb.conf")
.withFileFromClasspath("start.sh",
"org/apache/camel/test/infra/smb/services/start.sh"));
"org/apache/camel/test/infra/smb/services/start.sh")
.withBuildArg(FROM_IMAGE_ARG,
TestUtils.prependHubImageNamePrefixIfNeeded(
LocalPropertyResolver.getProperty(SmbContainer.class, SmbProperties.SMB_FROM_IMAGE))));

ContainerEnvironmentUtil.configurePort(this, fixedPort, SMB_PORT_DEFAULT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# limitations under the License.
#

FROM mirror.gcr.io/fedora:43 as samba
ARG FROMIMAGE=mirror.gcr.io/fedora:43
FROM $FROMIMAGE as samba
LABEL maintainer="orpiske@apache.org"
ENV SAMBA_ROOT /opt/camel/samba
EXPOSE 139 445
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## ---------------------------------------------------------------------------
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
smb.service.from.image=mirror.gcr.io/fedora:43