Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user defined dev services for any image #42587

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,11 @@
<artifactId>quarkus-devservices-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-devservices</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-devservices-deployment</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions extensions/devservices/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
<name>Quarkus - DevServices - Deployment</name>

<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-devservices</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-devservices-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package io.quarkus.devservices.deployment.any;

import java.util.Optional;

import org.testcontainers.containers.BindMode;

import io.quarkus.runtime.annotations.ConfigGroup;
import io.smallrye.config.WithDefault;

@ConfigGroup
public interface ClasspathResourceMappingConfig {

/**
* The value for the container path
*/
Optional<String> containerPath();

/**
* The Bind mode of the volume
*/
@WithDefault("READ_ONLY")
BindMode bindMode();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.quarkus.devservices.deployment.any;

import java.util.Map;

import io.quarkus.runtime.annotations.ConfigDocMapKey;
import io.quarkus.runtime.annotations.ConfigGroup;
import io.smallrye.config.WithDefaults;
import io.smallrye.config.WithParentName;

@ConfigGroup
public interface ClasspathResourceMappingsConfig {

/**
* Classpath Resource Mappings
*/
@ConfigDocMapKey("resource-path")
@WithParentName
@WithDefaults
Map<String, ClasspathResourceMappingConfig> classpathResourceMapping();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package io.quarkus.devservices.deployment.any;

import java.net.URL;
import java.util.Optional;
import java.util.OptionalInt;

import io.quarkus.runtime.annotations.ConfigDocSection;
import io.quarkus.runtime.annotations.ConfigGroup;
import io.smallrye.config.WithDefault;

@ConfigGroup
public interface DevServiceConfig {

/**
* Whether this dev service should be enabled
*/
@WithDefault("true")
boolean enabled();

/**
* The image to use
*/
Optional<String> imageName();

/**
* The container port. If not provided no port will be mapped
*/
OptionalInt containerPort();

/**
* The port that the contain port should be mapped to. If not provided a random port will be used
*/
OptionalInt mappedPort();

/**
* The version to use
*/
@WithDefault("latest")
String version();

/**
* The url the service started on. Might be nothing
*/
Optional<URL> url();

/**
* If the network should be SHARED
*/
@WithDefault("true")
boolean sharedNetwork();

/**
* If the container should be reused
*/
Optional<Boolean> reuse();

/**
* Access to the host
*/
@WithDefault("false")
boolean accessToHost();

/**
* Capture log
*/
@WithDefault("false")
boolean captureLog();

/**
* Wait for
*/
@ConfigDocSection
WaitForConfig waitFor();

/**
* Labels
*/
@ConfigDocSection
LabelsConfig label();

/**
* Env vars
*/
@ConfigDocSection
EnvVarsConfig env();

/**
* File System bindings
*/
@ConfigDocSection
FileSystemBindsConfig fileSystemBindings();

/**
* Classpath Resource mappings
*/
@ConfigDocSection
ClasspathResourceMappingsConfig classpathResourceMappings();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package io.quarkus.devservices.deployment.any;

import java.util.Map;

import io.quarkus.runtime.annotations.ConfigDocMapKey;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefaults;
import io.smallrye.config.WithParentName;

@ConfigMapping(prefix = "quarkus.devservices")
@ConfigRoot(phase = ConfigPhase.BUILD_TIME)
public interface DevServicesConfig {

/**
* DevServices Images.
*/
@ConfigDocMapKey("service-name")
@WithParentName
@WithDefaults
Map<String, DevServiceConfig> devservice();

}
Loading
Loading