From 61ff49f59caf81cd4c4f51dd1b2c85502b0771ff Mon Sep 17 00:00:00 2001 From: Sven Kiesewetter Date: Fri, 19 Jan 2024 08:00:31 +0100 Subject: [PATCH] fix: fix MSSQL container start (#92212) --- README.asciidoc | 40 +++++++++++- .../extension/DevelopmentConfiguration.kt | 5 ++ .../icm/docker/utils/AbstractTaskPreparer.kt | 15 ++++- .../gradle/icm/docker/utils/Configuration.kt | 14 ++++ .../utils/appsrv/AbstractASTaskPreparer.kt | 2 + .../utils/appsrv/CustomizationPreparer.kt | 3 + .../icm/docker/utils/mail/TaskPreparer.kt | 1 + .../icm/docker/utils/mail/TestTaskPreparer.kt | 65 ------------------- .../icm/docker/utils/mssql/TaskPreparer.kt | 1 + .../icm/docker/utils/nginx/TaskPreparer.kt | 1 + .../icm/docker/utils/oracle/TaskPreparer.kt | 1 + .../icm/docker/utils/redis/TaskPreparer.kt | 2 + .../docker/utils/solrcloud/SolrPreparer.kt | 1 + .../icm/docker/utils/solrcloud/ZKPreparer.kt | 1 + .../docker/utils/webserver/WAATaskPreparer.kt | 1 + .../docker/utils/webserver/WATaskPreparer.kt | 2 + .../ICMDockerPluginIntegegrationSpec.groovy | 11 ++-- 17 files changed, 90 insertions(+), 76 deletions(-) delete mode 100644 src/main/kotlin/com/intershop/gradle/icm/docker/utils/mail/TestTaskPreparer.kt diff --git a/README.asciidoc b/README.asciidoc index 46ff081..8e54cb0 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -1,5 +1,5 @@ = Intershop Commerce Management - Docker Plugins -:latestRevision: 4.0.0 +:latestRevision: 4.0.1 :toc: :icons: font @@ -347,6 +347,7 @@ The following properties are part of the <>. | `intershop.db.mssql.dbname` | the name of the actual DB to be created | String | Optional | `icmtestdb` + | `intershop.db.mssql.recreatedb` | controls if the actual DB is recreated on container start | Boolean | Optional | `false` + | `intershop.db.mssql.recreateuser` | controls if the DB-user is recreated on container start | Boolean | Optional | `false` + +| `intershop.db.mssql.useHostUser` | controls if the host system's current user is used for the container start | Boolean | Optional | `false` + | `intershop.jdbc.user` | the name of the actual DB user to be created | String | Optional | `intershop` + | `intershop.jdbc.password` | the password of the actual DB user to be created | String | Optional | `intershop` + |=== @@ -359,6 +360,7 @@ The following properties are part of the <>. | `intershop.db.oracle.listenerport` | Exposed listener port of the database. | Integer | Optional | `1521` + | `intershop.db.oracle.port` | Exposed enterprise manager port of the oracle db. | Integer | Optional | `1521` + +| `intershop.db.oracle.useHostUser` | controls if the host system's current user is used for the container start | Boolean | Optional | `false` + |=== ===== WA [[WAConfiguration]] @@ -377,6 +379,16 @@ The following properties are part of the <>. | `intershop.ws.readinessProbe.interval` | interval in seconds to be used to check if the WebAdapter is ready | Integer | Optional | `2` + | `intershop.ws.readinessProbe.timeout` | max. number of seconds to wait for the WebAdapter to become ready | Integer | Optional | `30` + | `webserver.use.http2` | enables/disables usage of HTTP2 | Boolean | Optional | `false` + +| `wa.useHostUser` | controls if the host system's current user is used for the container start | Boolean | Optional | `false` + +|=== + +===== WAA [[WAAConfiguration]] + +[cols="10%,60%,10%,10%,10%", width="99%, options="header"] +|=== +| Key | Description | Co-domain | Mandatory/Optional | Default value + +| `waa.useHostUser` | controls if the host system's current user is used for the container start | Boolean | Optional | `false` + |=== ===== NGINX [[NGINXConfiguration]] @@ -389,6 +401,7 @@ The following properties are part of the <>. | `nginx.cert.path` | the host path to look for TLS certificate and private key (if not defined the certificates will be mounted from the Webserver certificate path) | Path | Optional | + | `nginx.cert.filename` | name of the certificate file | String | Optional | `fullchain.pem` + | `nginx.privatekey.filename` | name of the certificate private key file | String | Optional | `privkey.pem` + +| `nginx.useHostUser` | controls if the host system's current user is used for the container start | Boolean | Optional | `false` + |=== ===== Solr [[SolrConfiguration]] @@ -399,6 +412,7 @@ The following properties are part of the <>. | `solr.clusterIndexPrefix` | prefix to be used for indexed inside Solr | String | Optional | + | `solr.port` | the host port to be used for the Solr server primary port | Integer | Optional | `8983` + +| `solr.useHostUser` | controls if the host system's current user is used for the container start | Boolean | Optional | `false` + |=== ===== ZooKeeper [[ZKConfiguration]] @@ -409,12 +423,32 @@ The following properties are part of the <>. | `zookeeper.port` | the host port to be used for the Zookeeper's primary port | Integer | Optional | `2181` + | `zookeeper.metrics.port` | the host port to be used for the Zookeeper's metrics port | Integer | Optional | `7000` + +| `zookeper.useHostUser` | controls if the host system's current user is used for the container start | Boolean | Optional | `false` + |=== ===== Mail [[MailConfiguration]] -There are no special configuration properties for the mail server. -The SMTP port is `25` and the web interface listened on 8025. Mails are stored in the build directory `mailoutput`. +[cols="10%,60%,10%,10%,10%", width="99%, options="header"] +|=== +| Key | Description | Co-domain | Mandatory/Optional | Default value + +| `mail.smtp.host.port` | the host port to be used for the SMTP port | Integer | Optional | `25` + +| `mail.admin.host.port` | the host port to be used for the MailHog administration/backoffice port | Integer | Optional | `8025` + +| `mail.readinessProbe.interval` | interval in seconds to be used to check if the mail server is ready | Integer | Optional | `2` + +| `mail.readinessProbe.timeout` | max. number of seconds to wait for the mail server to become ready | Integer | Optional | `30` + +| `mail.useHostUser` | controls if the host system's current user is used for the container start | Boolean | Optional | `true` + +|=== + +Mails are stored in the build directory `mailoutput`. + +===== Redis [[RedisConfiguration]] + +[cols="10%,60%,10%,10%,10%", width="99%, options="header"] +|=== +| Key | Description | Co-domain | Mandatory/Optional | Default value + +| `redis.useHostUser` | controls if the host system's current user is used for the container start | Boolean | Optional | `true` + +|=== == Intershop Commerce Management Customization Docker Plugin This plugin configures additional tasks of an Intershop Commerce Management customization project. It uses the same Gradle diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/extension/DevelopmentConfiguration.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/extension/DevelopmentConfiguration.kt index 3ab0843..d4178d9 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/extension/DevelopmentConfiguration.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/extension/DevelopmentConfiguration.kt @@ -227,6 +227,11 @@ open class DevelopmentConfiguration } } + fun getBooleanProperty(property: String, defaultValue: Boolean): Boolean { + val strValue = configProperties.getProperty(property, defaultValue.toString()) + return strValue.toBoolean() + } + fun getDurationProperty(property: String, defaultSeconds: Int): Duration { return Duration.ofSeconds(getIntProperty (property, defaultSeconds).toLong()) } diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/AbstractTaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/AbstractTaskPreparer.kt index c5b1615..68767da 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/AbstractTaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/AbstractTaskPreparer.kt @@ -42,6 +42,11 @@ abstract class AbstractTaskPreparer( protected abstract fun getExtensionName(): String protected open fun getContainerExt(): String = getExtensionName().lowercase() protected abstract fun getImage(): Provider + protected fun useHostUser() : Boolean { + return dockerExtension.developmentConfig.getBooleanProperty(getUseHostUserConfigProperty(), useHostUserDefaultValue()) + } + protected open fun useHostUserDefaultValue() : Boolean = false + protected abstract fun getUseHostUserConfigProperty() : String; protected val dockerExtension = project.extensions.getByType() protected val icmExtension = project.extensions.getByType() @@ -90,13 +95,17 @@ abstract class AbstractTaskPreparer( task.group = "icm container ${getContainerExt()}" task.attachStderr.set(true) task.attachStdout.set(true) - task.hostConfig.autoRemove.set(true) + //task.hostConfig.autoRemove.set(true) task.containerName.set(getContainerName()) val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem() - if(! os.isWindows) { - val uid = com.sun.security.auth.module.UnixSystem().uid + if(useHostUser() && !os.isWindows) { + val system = com.sun.security.auth.module.UnixSystem() + val uid = system.uid + val userName = system.username + val gid = system.gid + project.logger.info("Using user {}({}:{}) to start container {}", userName, uid, gid, getContainerName()) task.user.set(uid.toString()) } } diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/Configuration.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/Configuration.kt index afdcbfc..f2705d8 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/Configuration.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/Configuration.kt @@ -39,6 +39,8 @@ object Configuration { const val DB_MSSQL_DBNAME = "intershop.db.mssql.dbname" const val DB_MSSQL_DBNAME_VALUE = "icmtestdb" + const val DB_MSSQL_USE_HOST_USER = "intershop.db.mssql.useHostUser" + const val DB_ORACLE_LISTENERPORT = "intershop.db.oracle.listenerport" const val DB_ORACLE_CONTAINER_LISTENERPORT = "intershop.db.container.oracle.listenerport" @@ -51,6 +53,8 @@ object Configuration { const val DB_ORACLE_PORT_VALUE = "5500" const val DB_ORACLE_CONTAINER_PORT_VALUE = "5500" + const val DB_ORACLE_USE_HOST_USER = "intershop.db.oracle.useHostUser" + const val DB_TYPE = "intershop.databaseType" const val DB_JDBC_URL = "intershop.jdbc.url" @@ -111,6 +115,9 @@ object Configuration { const val WS_READINESS_PROBE_TIMEOUT = "intershop.db.readinessProbe.timeout" const val WS_READINESS_PROBE_TIMEOUT_VALUE = 30 // 30 secs + const val WA_USE_HOST_USER = "wa.useHostUser" + const val WAA_USE_HOST_USER = "waa.useHostUser" + const val AS_ADMIN_USER_NAME = "intershop.smc.admin.user.name" const val AS_ADMIN_USER_NAME_VALUE = "admin" const val AS_ADMIN_USER_PASSWORD = "intershop.smc.admin.user.password" @@ -118,17 +125,20 @@ object Configuration { const val AS_READINESS_PROBE_INTERVAL_VALUE = 15 // 15 secs const val AS_READINESS_PROBE_TIMEOUT = "intershop.as.readinessProbe.timeout" const val AS_READINESS_PROBE_TIMEOUT_VALUE = 100 * 60 // 100 mins (full dbinit may be necessary) + const val AS_USE_HOST_USER = "intershop.as.useHostUser" const val SOLR_CLOUD_HOSTLIST = "solr.zooKeeperHostList" const val SOLR_CLOUD_INDEXPREFIX = "solr.clusterIndexPrefix" const val SOLR_CLOUD_HOST_PORT = "solr.port" const val SOLR_CLOUD_HOST_PORT_VALUE = 8983 const val SOLR_DATA_FOLDER_PATH = "solr.data.folder.path" + const val SOLR_USE_HOST_USER = "solr.useHostUser" const val ZOOKEEPER_HOST_PORT = "zookeeper.port" const val ZOOKEEPER_HOST_PORT_VALUE = 2181 const val ZOOKEEPER_METRICS_HOST_PORT = "zookeeper.metrics.port" const val ZOOKEEPER_METRICS_HOST_PORT_VALUE = 7000 + const val ZOOKEEPER_USE_HOST_USER = "zookeeper.useHostUser" const val SSL_VERIFICATION = "ssl.verification" @@ -160,6 +170,7 @@ object Configuration { const val MAIL_READINESS_PROBE_INTERVAL_VALUE = 1 // 1 secs const val MAIL_READINESS_PROBE_TIMEOUT = "mail.readinessProbe.timeout" const val MAIL_READINESS_PROBE_TIMEOUT_VALUE = 15 // 15 secs + const val MAIL_USE_HOST_USER = "mail.useHostUser" const val NGINX_HTTP_PORT = "nginx.http.port" const val NGINX_HTTPS_PORT = "nginx.https.port" @@ -172,6 +183,9 @@ object Configuration { const val NGINX_CERT_FILENAME_VALUE = "fullchain.pem" const val NGINX_PRIVATEKEY_FILENAME = "nginx.privatekey.filename" const val NGINX_PRIVATEKEY_FILENAME_VALUE = "privkey.pem" + const val NGINX_USE_HOST_USER = "nginx.useHostUser" + + const val REDIS_USE_HOST_USER = "redis.useHostUser" const val INTERSHOP_ENVIRONMENT_PREFIX = "intershop.environment." } diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/AbstractASTaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/AbstractASTaskPreparer.kt index eab6e27..8282445 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/AbstractASTaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/appsrv/AbstractASTaskPreparer.kt @@ -44,6 +44,8 @@ abstract class AbstractASTaskPreparer( initAppTasks() } + override fun getUseHostUserConfigProperty(): String = Configuration.AS_USE_HOST_USER + val prepareServer: TaskProvider by lazy { project.tasks.named(TaskPreparer.TASK_PREPARESERVER) } 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 c170830..a3bd9bd 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 @@ -33,6 +33,9 @@ class CustomizationPreparer(project: Project, override fun getExtensionName(): String = "${customizationName}$extPrefix" override fun getImage(): Provider = imagePath + override fun getUseHostUserConfigProperty(): String = getExtensionName()+".useHostUser" + + override fun useHostUserDefaultValue(): Boolean = false init { initBaseTasks() 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 c77b759..7e7fe4f 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 @@ -36,6 +36,7 @@ class TaskPreparer(project: Project, override fun getExtensionName(): String = extName override fun getImage(): Provider = dockerExtension.images.mailsrv + override fun getUseHostUserConfigProperty(): String = Configuration.MAIL_USE_HOST_USER init { initBaseTasks() diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/mail/TestTaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/mail/TestTaskPreparer.kt deleted file mode 100644 index 8c4ce0c..0000000 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/mail/TestTaskPreparer.kt +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2020 Intershop Communications AG. - * - * Licensed 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. - * - */ -package com.intershop.gradle.icm.docker.utils.mail - -import com.intershop.gradle.icm.docker.tasks.PrepareNetwork -import com.intershop.gradle.icm.docker.tasks.StartExtraContainer -import com.intershop.gradle.icm.docker.utils.AbstractTaskPreparer -import org.gradle.api.Project -import org.gradle.api.provider.Provider - -open class TestTaskPreparer(project: Project, - networkTask: Provider) : AbstractTaskPreparer(project, networkTask) { - - companion object { - const val extName: String = "TestMailSrv" - } - - override fun getExtensionName(): String = extName - override fun getImage(): Provider = dockerExtension.images.testmailsrv - - init { - initBaseTasks() - - project.tasks.register ("start${getExtensionName()}", StartExtraContainer::class.java) { task -> - configureContainerTask(task) - task.description = "Starts an special test mail server for ISHUnitTests" - - task.targetImageId( project.provider { pullTask.get().image.get() } ) - task.image.set(pullTask.get().image) - - task.entrypoint.set(listOf( - "bash", "-c", - "mkdir -p /data/test-mails; ln -sf /data/test-mails /var/tmp; java -jar " + - "-Xms64M -Xmx128M -Djava.security.egd=file:/dev/./urandom /app.jar " + - "--iste-mail.smtp-port=25 --spring.output.ansi.enabled=NEVER" - )) - - task.hostConfig.portBindings.set(listOf("25:25")) - task.hostConfig.binds.set( project.provider { - mutableMapOf( - project.layout.buildDirectory.dir("testMails").get().asFile.absolutePath - to "/data/test-mails" - ) - }) - - task.hostConfig.network.set(networkId) - - task.dependsOn(pullTask, networkTask) - } - } -} diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/mssql/TaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/mssql/TaskPreparer.kt index 531d6b3..d2c40a7 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/mssql/TaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/mssql/TaskPreparer.kt @@ -34,6 +34,7 @@ class TaskPreparer(project: Project, override fun getExtensionName(): String = extName override fun getImage(): Provider = dockerExtension.images.mssqldb + override fun getUseHostUserConfigProperty(): String = Configuration.DB_MSSQL_USE_HOST_USER init { initBaseTasks() diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/nginx/TaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/nginx/TaskPreparer.kt index 7c9e250..d83bb9b 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/nginx/TaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/nginx/TaskPreparer.kt @@ -46,6 +46,7 @@ class TaskPreparer( override fun getExtensionName(): String = extName override fun getImage(): Provider = dockerExtension.images.nginx + override fun getUseHostUserConfigProperty(): String = Configuration.NGINX_USE_HOST_USER init { initBaseTasks() diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/oracle/TaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/oracle/TaskPreparer.kt index 1926398..1a52a53 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/oracle/TaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/oracle/TaskPreparer.kt @@ -33,6 +33,7 @@ class TaskPreparer(project: Project, override fun getExtensionName(): String = extName override fun getImage(): Provider = dockerExtension.images.oracledb + override fun getUseHostUserConfigProperty(): String = Configuration.DB_ORACLE_USE_HOST_USER init { initBaseTasks() diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/redis/TaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/redis/TaskPreparer.kt index ef8f158..b6dbf48 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/redis/TaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/redis/TaskPreparer.kt @@ -19,6 +19,7 @@ package com.intershop.gradle.icm.docker.utils.redis import com.intershop.gradle.icm.docker.tasks.PrepareNetwork import com.intershop.gradle.icm.docker.tasks.StartExtraContainer import com.intershop.gradle.icm.docker.utils.AbstractTaskPreparer +import com.intershop.gradle.icm.docker.utils.Configuration import com.intershop.gradle.icm.docker.utils.PortMapping import org.gradle.api.Project import org.gradle.api.provider.Provider @@ -36,6 +37,7 @@ class TaskPreparer( override fun getExtensionName(): String = extName override fun getImage(): Provider = dockerExtension.images.redis + override fun getUseHostUserConfigProperty(): String = Configuration.REDIS_USE_HOST_USER init { initBaseTasks() diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/solrcloud/SolrPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/solrcloud/SolrPreparer.kt index b1bd1a3..64e65b7 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/solrcloud/SolrPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/solrcloud/SolrPreparer.kt @@ -39,6 +39,7 @@ class SolrPreparer( override fun getExtensionName(): String = extName override fun getImage(): Provider = dockerExtension.images.solr + override fun getUseHostUserConfigProperty(): String = Configuration.SOLR_USE_HOST_USER init { initBaseTasks() diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/solrcloud/ZKPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/solrcloud/ZKPreparer.kt index 27ab10e..6d4cd28 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/solrcloud/ZKPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/solrcloud/ZKPreparer.kt @@ -39,6 +39,7 @@ class ZKPreparer( override fun getExtensionName(): String = extName override fun getImage(): Provider = dockerExtension.images.zookeeper + override fun getUseHostUserConfigProperty(): String = Configuration.ZOOKEEPER_USE_HOST_USER init { initBaseTasks() diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/webserver/WAATaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/webserver/WAATaskPreparer.kt index 41c4570..109df01 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/webserver/WAATaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/webserver/WAATaskPreparer.kt @@ -35,6 +35,7 @@ class WAATaskPreparer(project: Project, override fun getExtensionName(): String = extName override fun getImage(): Provider = dockerExtension.images.webadapteragent + override fun getUseHostUserConfigProperty(): String = Configuration.WAA_USE_HOST_USER init{ initBaseTasks() diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/webserver/WATaskPreparer.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/webserver/WATaskPreparer.kt index d5eb65b..63a622f 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/utils/webserver/WATaskPreparer.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/utils/webserver/WATaskPreparer.kt @@ -22,6 +22,7 @@ import com.intershop.gradle.icm.docker.tasks.StartExtraContainer import com.intershop.gradle.icm.docker.tasks.utils.ContainerEnvironment import com.intershop.gradle.icm.docker.utils.AbstractTaskPreparer import com.intershop.gradle.icm.docker.utils.Configuration +import com.intershop.gradle.icm.docker.utils.Configuration.WA_USE_HOST_USER import com.intershop.gradle.icm.docker.utils.Configuration.WS_READINESS_PROBE_INTERVAL import com.intershop.gradle.icm.docker.utils.Configuration.WS_READINESS_PROBE_INTERVAL_VALUE import com.intershop.gradle.icm.docker.utils.Configuration.WS_READINESS_PROBE_TIMEOUT @@ -43,6 +44,7 @@ class WATaskPreparer( override fun getExtensionName(): String = extName override fun getImage(): Provider = dockerExtension.images.webadapter + override fun getUseHostUserConfigProperty(): String = WA_USE_HOST_USER val httpContainerPort: Int diff --git a/src/test/groovy/com/intershop/gradle/icm/docker/ICMDockerPluginIntegegrationSpec.groovy b/src/test/groovy/com/intershop/gradle/icm/docker/ICMDockerPluginIntegegrationSpec.groovy index 451cc88..c193dc2 100644 --- a/src/test/groovy/com/intershop/gradle/icm/docker/ICMDockerPluginIntegegrationSpec.groovy +++ b/src/test/groovy/com/intershop/gradle/icm/docker/ICMDockerPluginIntegegrationSpec.groovy @@ -222,12 +222,12 @@ class ICMDockerPluginIntegegrationSpec extends AbstractIntegrationGroovySpec { modules { solrExt { dependency.set("com.intershop.search:solrcloud:1.0.0") - image.set("intershophub/icm-as:11.0.1") + image.set("intershophub/icm-as:11.7.0") testImage.set("intershopmock/icm-as-mock:mock") } paymentExt { dependency.set("com.intershop.payment:paymenttest:1.0.0") - image.set("intershophub/icm-as:11.0.1") + image.set("intershophub/icm-as:11.7.0") testImage.set("intershopmock/icm-as-mock:mock") } } @@ -563,11 +563,11 @@ class ICMDockerPluginIntegegrationSpec extends AbstractIntegrationGroovySpec { modules { solrExt { dependency.set("com.intershop.search:solrcloud:1.0.0") - image.set("intershophub/icm-as:11.0.1") + image.set("intershophub/icm-as:11.7.0") } paymentExt { dependency.set("com.intershop.payment:paymenttest:1.0.0") - image.set("intershophub/icm-as:11.0.1") + image.set("intershophub/icm-as:11.7.0") } } } @@ -704,8 +704,9 @@ class ICMDockerPluginIntegegrationSpec extends AbstractIntegrationGroovySpec { when: def result = getPreparedGradleRunner() - .withArguments("pullAS", "--altImage=busybox:latest", "--forcePull", "-s") + .withArguments("pullAS", "--altImage=intershophub/icm-webadapter:2.2.0", "--forcePull", "-s", "-Picm.docker.config=/home/sven/intershop/config") .withGradleVersion(gradleVersion) + .withDebug(true) .build() then: