From 4abd8b1830e2fd6175ddd936464f28790f8fb98a Mon Sep 17 00:00:00 2001 From: skiesewetter-intershop <82586807+skiesewetter-intershop@users.noreply.github.com> Date: Tue, 20 Feb 2024 15:39:50 +0100 Subject: [PATCH] chore: consume icmjobrunner-2.0.0 (#93233) * consuming icmjobrunner:2.0.0 * changes for new JobRunner API * minor exception handling improvement * typo fixed --- build.gradle.kts | 2 +- .../gradle/icm/docker/tasks/AbstractJobRunnerTask.kt | 9 +++++---- .../gradle/icm/docker/utils/AbstractTaskPreparer.kt | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5ea2ae8..726b0a0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -305,6 +305,6 @@ dependencies { implementation("org.apache.solr:solr-solrj:9.4.0") implementation("com.bmuschko.docker-remote-api:com.bmuschko.docker-remote-api.gradle.plugin:9.3.6") implementation("com.intershop.gradle.icm:icm-gradle-plugin:6.0.0") - implementation("com.intershop.gradle.jobrunner:icmjobrunner:1.0.5") + implementation("com.intershop.gradle.jobrunner:icmjobrunner:2.0.0") } diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/AbstractJobRunnerTask.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/AbstractJobRunnerTask.kt index 58fca34..8032030 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/AbstractJobRunnerTask.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/AbstractJobRunnerTask.kt @@ -70,15 +70,16 @@ abstract class AbstractJobRunnerTask @Inject constructor(objectFactory: ObjectFa Protocol.HTTP } val user = User(userName.get(), userPassword.get()) - val server = Server(protocolObj, wsUri.host, wsUri.port.toString()) + val server = Server(protocolObj, wsUri.host, wsUri.port) val runner = JobRunner( server = server, domain = domain.get(), - srvgroup = servergroup.get(), + srvGroup = servergroup.get(), user = user, timeout = maxWait.get(), - logger = project.logger) + logger = project.logger + ) if (sslVerification.get()) { runner.enableSSLVerification() @@ -91,7 +92,7 @@ abstract class AbstractJobRunnerTask @Inject constructor(objectFactory: ObjectFa try { jobRunner.triggerJob(jobName) } catch (ex: JobRunnerException) { - throw GradleException(ex.message ?: "There was a technical problem to run '$jobName'") + throw GradleException(ex.message ?: "There was a technical problem to run '$jobName'", ex) } } } 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 ce2b62e..d741d6f 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 @@ -142,7 +142,7 @@ abstract class AbstractTaskPreparer( ): TaskProvider where T : CreateExtraContainer { return project.tasks.register(taskNameOf("create"), taskType) { task -> task.group = taskGroup - task.description = "Creates the ${getContainerExt()}-container is not already existing" + task.description = "Creates the ${getContainerExt()}-container if not already existing" task.attachStderr.set(true) task.attachStdout.set(true) task.hostConfig.autoRemove.set(true)