diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/ASTaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/ASTaskPreparer.kt index 4f4a496..29108b9 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/ASTaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/ASTaskPreparer.kt @@ -68,89 +68,6 @@ class ASTaskPreparer( ) } - /* FIXME SKR project.tasks.register("start${this.getExtensionName()}", StartServerContainer::class.java) { task -> - - configureContainerTask(task) - - task.description = "Starts Production Application Server in a container" - - task.targetImageId(project.provider { pullTask.get().image.get() }) - task.image.set(pullTask.get().image) - - task.hostConfig.binds.set(project.provider { - getServerVolumes(task, true).apply { - project.logger.info( - "Using the following volume binds for container startup in task {}: {}", - task.name, this - ) - } - }) - - task.withPortMappings(*getPortMappings().toTypedArray()) - - task.hostConfig.network.set(networkId) - task.withEnvironment( - ICMContainerEnvironmentBuilder() - .withContainerName(getContainerName()) - .build() - ) - - val devConfig = project.extensions.getByType().developmentConfig - task.withHttpProbe( - URI.create( - StartServerContainer.PATTERN_READINESS_PROBE_URL.format( - devConfig.asPortConfiguration.managementConnector.get().hostPort - ) - ), - devConfig.getDurationProperty( - Configuration.AS_READINESS_PROBE_INTERVAL, - Configuration.AS_READINESS_PROBE_INTERVAL_VALUE - ), - devConfig.getDurationProperty( - Configuration.AS_READINESS_PROBE_TIMEOUT, - Configuration.AS_READINESS_PROBE_TIMEOUT_VALUE - ) - ) - - val solrCloudHostList = devConfig.getConfigProperty(Configuration.SOLR_CLOUD_HOSTLIST) - val solrCloudIndexPrefix = devConfig.getConfigProperty(Configuration.SOLR_CLOUD_INDEXPREFIX) - - val mailPort = devConfig.getConfigProperty(Configuration.MAIL_SMTP_PORT) - val mailHost = devConfig.getConfigProperty(Configuration.MAIL_SMTP_HOST) - - if(zkTaskProvider != null && solrCloudHostList.isEmpty()) { - task.solrCloudZookeeperHostList = project.provider { - val containerPort = zkTaskProvider!!.get().getPortMappings().stream() - .filter { it.name == ZKPreparer.CONTAINER_PORTMAPPING } - .findFirst().get().containerPort - "${zkTaskProvider!!.get().containerName.get()}:${containerPort}" - } - } else if (solrCloudHostList.isNotEmpty()){ - task.solrCloudZookeeperHostList = project.provider { - solrCloudHostList - } - - if(solrCloudIndexPrefix.isNotEmpty()) { - task.withEnvironment(ICMContainerEnvironmentBuilder(). - withAdditionalEnvironment("SOLR_CLUSTERINDEXPREFIX", solrCloudIndexPrefix).build()) - } - } - - if(mailServerTaskProvider != null && mailPort.isEmpty() && mailHost.isEmpty()) { - task.mailServer = project.provider { - HostAndPort( - mailServerTaskProvider!!.get().containerName.get(), - mailServerTaskProvider!!.get().getPrimaryPortMapping().get().containerPort - ) - } - } else if (mailPort.isNotEmpty() && mailHost.isNotEmpty()){ - task.mailServer = project.provider { - HostAndPort(mailHost, mailPort.toInt()) - } - } - - - }*/ } } diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/ASTestContainerTaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/ASTestContainerTaskPreparer.kt index 51a9b52..9ac3112 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/ASTestContainerTaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/ASTestContainerTaskPreparer.kt @@ -80,68 +80,5 @@ class ASTestContainerTaskPreparer( } - - /* FIXME SKR project.tasks.register("start${this.getExtensionName()}", StartServerContainer::class.java) { task -> - - configureContainerTask(task) - - task.description = "Starts Production Application Server in a container - only for use in icm-as" - - task.targetImageId(project.provider { pullTask.get().image.get() }) - task.image.set(pullTask.get().image) - - task.hostConfig.binds.set(project.provider { - getServerVolumes(task, false).apply { - project.logger.info( - "Using the following volume binds for container startup in task {}: {}", - task.name, this - ) - } - }) - - task.withPortMappings(*getPortMappings().toTypedArray()) - - task.hostConfig.network.set(networkId) - task.withEnvironment( - ICMContainerEnvironmentBuilder() - .withContainerName(getContainerName()) - .build() - ) - - val devConfig = project.extensions.getByType().developmentConfig - task.withHttpProbe( - URI.create( - StartServerContainer.PATTERN_READINESS_PROBE_URL.format( - devConfig.asPortConfiguration.managementConnector.get().hostPort - ) - ), - devConfig.getDurationProperty( - Configuration.AS_READINESS_PROBE_INTERVAL, - Configuration.AS_READINESS_PROBE_INTERVAL_VALUE - ), - devConfig.getDurationProperty( - Configuration.AS_READINESS_PROBE_TIMEOUT, - Configuration.AS_READINESS_PROBE_TIMEOUT_VALUE - ) - ) - - val mailPort = devConfig.getConfigProperty(Configuration.MAIL_SMTP_PORT) - val mailHost = devConfig.getConfigProperty(Configuration.MAIL_SMTP_HOST) - - if(mailServerTaskProvider != null && mailPort.isEmpty() && mailHost.isEmpty()) { - task.mailServer = project.provider { - HostAndPort( - mailServerTaskProvider!!.get().containerName.get(), - mailServerTaskProvider!!.get().getPrimaryPortMapping().get().containerPort - ) - } - } else if (mailPort.isNotEmpty() && mailHost.isNotEmpty()){ - task.mailServer = project.provider { - HostAndPort(mailHost, mailPort.toInt()) - } - } - - - } */ } } diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/CustomizationPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/CustomizationPreparer.kt index 070b342..b5d6d66 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/CustomizationPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/CustomizationPreparer.kt @@ -46,25 +46,5 @@ class CustomizationPreparer(project: Project, registerStartContainerTask(createTask).configure { task -> task.description = "Starts customization '${customizationName}'" } - - - /* FIXME SKR project.tasks.register("start${getExtensionName()}", StartExtraContainer::class.java) { task -> - - configureContainerTask(task) - task.description = "Starts customization '${customizationName}'" - - task.targetImageId(project.provider { pullTask.get().image.get() }) - task.image.set(pullTask.get().image) - - task.hostConfig.binds.set( - mutableMapOf( - "${dockerExtension.containerPrefix}-customizations" to "/customizations" - ) - ) - - task.dependsOn(pullTask, networkTask) - - - }*/ } } diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/WaitingAsTaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/WaitingAsTaskPreparer.kt index 6b4be46..f8e5d0d 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/WaitingAsTaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/WaitingAsTaskPreparer.kt @@ -61,68 +61,6 @@ class WaitingAsTaskPreparer( } is executed in preparation of this task and supports parameters that you may expect to get supported by this task. """.trimIndent() } - - - /* FIXME SKR project.tasks.register("start${this.getExtensionName()}", StartServerContainer::class.java) { task -> - configureContainerTask(task) - - task.description = "Start container without any special command (sleep)" - - task.targetImageId(project.provider { pullTask.get().image.get() }) - task.image.set(pullTask.get().image) - - task.entrypoint.set(listOf("/intershop/bin/startAndWait.sh")) - - task.hostConfig.binds.set(project.provider { - getServerVolumes(task, true).apply { - project.logger.info("Using the following volume binds for container startup in task {}: {}", - task.name, this) - } - }) - task.withPortMappings(*getPortMappings().toTypedArray()) - task.hostConfig.network.set(networkId) - - val devConfig = project.extensions.getByType().developmentConfig - - val solrCloudHostList = devConfig.getConfigProperty(Configuration.SOLR_CLOUD_HOSTLIST) - val solrCloudIndexPrefix = devConfig.getConfigProperty(Configuration.SOLR_CLOUD_INDEXPREFIX) - - val mailPort = devConfig.getConfigProperty(Configuration.MAIL_SMTP_PORT) - val mailHost = devConfig.getConfigProperty(Configuration.MAIL_SMTP_HOST) - - if(zkTaskProvider != null && solrCloudHostList.isEmpty()) { - task.solrCloudZookeeperHostList = project.provider { - val containerPort = zkTaskProvider!!.get().getPortMappings().stream() - .filter { it.name == ZKPreparer.CONTAINER_PORTMAPPING } - .findFirst().get().containerPort - "${zkTaskProvider!!.get().containerName.get()}:${containerPort}" - } - } else if (solrCloudHostList.isNotEmpty()){ - task.solrCloudZookeeperHostList = project.provider { - solrCloudHostList - } - - if(solrCloudIndexPrefix.isNotEmpty()) { - task.withEnvironment( - ICMContainerEnvironmentBuilder(). - withAdditionalEnvironment("SOLR_CLUSTERINDEXPREFIX", solrCloudIndexPrefix).build()) - } - } - - if(mailServerTaskProvider != null && mailPort.isEmpty() && mailHost.isEmpty()) { - task.mailServer = project.provider { - HostAndPort( - mailServerTaskProvider!!.get().containerName.get(), - mailServerTaskProvider!!.get().getPrimaryPortMapping().get().containerPort - ) - } - } else if (mailPort.isNotEmpty() && mailHost.isNotEmpty()){ - task.mailServer = project.provider { - HostAndPort(mailHost, mailPort.toInt()) - } - } - - }*/ } } diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/mail/TaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/mail/TaskPreparer.kt index 228d1a8..2309129 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/mail/TaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/mail/TaskPreparer.kt @@ -37,6 +37,7 @@ class TaskPreparer(project: Project, override fun getExtensionName(): String = EXT_NAME override fun getImage(): Provider = dockerExtension.images.mailsrv override fun getUseHostUserConfigProperty(): String = Configuration.MAIL_USE_HOST_USER + override fun useHostUserDefaultValue(): Boolean = true init { initBaseTasks()