From 369bae3631c73c43d5438c9fafc5c3e16769ff53 Mon Sep 17 00:00:00 2001 From: DevDavido <997605+DevDavido@users.noreply.github.com> Date: Wed, 10 Jul 2024 18:46:01 +0200 Subject: [PATCH] feat: Provide configurable environment to WA container --- .../com/intershop/gradle/icm/docker/utils/Configuration.kt | 1 + .../gradle/icm/docker/utils/webserver/WATaskPreparer.kt | 3 +++ 2 files changed, 4 insertions(+) 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 baa481a..5106845 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 @@ -89,6 +89,7 @@ object Configuration { const val WS_SERVER_CERT = "webserver.cert.server" const val WS_SERVER_PRIVAT = "webserver.cert.privatekey" + const val WS_ENVIRONMENT = "environment" const val WS_SERVER_HTTP2 = "webserver.use.http2" const val WS_URL = "intershop.WebServerURL" 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 0826486..68465be 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 @@ -67,6 +67,9 @@ class WATaskPreparer( val env = with(dockerExtension.developmentConfig) { val env = ContainerEnvironment() + val environment = getConfigProperty(Configuration.WS_ENVIRONMENT, "development") + env.add("ENVIRONMENT", environment) + val serverCertName = getConfigProperty(Configuration.WS_SERVER_CERT, "") if (serverCertName.isNotBlank()) { env.add("ICM_SERVERCERT", serverCertName)