com.avast.gradle.dockercompose.ServiceInfo.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-docker-compose-plugin Show documentation
Show all versions of gradle-docker-compose-plugin Show documentation
Simplifies usage of Docker Compose for integration testing in Gradle environment.
package com.avast.gradle.dockercompose
import groovy.transform.Immutable
@Immutable(knownImmutableClasses = [ContainerInfo], copyWith = true)
class ServiceInfo {
String name
/* Key is instance name, for example service_1 */
Map containerInfos = [:]
String getHost() { firstContainer?.serviceHost.host }
Map getPorts() { tcpPorts }
Map getTcpPorts() { firstContainer?.tcpPorts ?: [:] }
Map getUdpPorts() { firstContainer?.udpPorts ?: [:] }
Integer getPort() { firstContainer?.port }
Integer getTcpPort() { firstContainer?.tcpPort }
Integer getUdpPort() { firstContainer?.udpPort }
ContainerInfo getFirstContainer() {
containerInfos.values()?.find()
}
def propertyMissing(String name) {
return containerInfos[name]
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy