From bc57185cb83670640452cb91c3e8e8c4a7c78431 Mon Sep 17 00:00:00 2001 From: Patrick Mirwald Date: Thu, 15 Aug 2024 18:43:10 +0200 Subject: [PATCH] feat(OctopusDeployExtension): add back commitLinkBaseUrl to gitlab() --- .../octopusdeploy/extensions/OctopusDeployExtension.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/kotlin/com/liftric/octopusdeploy/extensions/OctopusDeployExtension.kt b/src/main/kotlin/com/liftric/octopusdeploy/extensions/OctopusDeployExtension.kt index 3a0791c..3de225b 100644 --- a/src/main/kotlin/com/liftric/octopusdeploy/extensions/OctopusDeployExtension.kt +++ b/src/main/kotlin/com/liftric/octopusdeploy/extensions/OctopusDeployExtension.kt @@ -93,7 +93,11 @@ abstract class OctopusDeployExtension(val project: Project) { */ abstract val useShortCommitHashes: Property + /** + * Default `buildInformationAddition` implementation adding context from the CI environment for Gitlab CI. Also sets `commitLinkBaseUrl`. + */ fun gitlab(additional: BuildInformationCli.() -> Unit = {}) { + commitLinkBaseUrl.set("${System.getenv("CI_PROJECT_URL")?.removeSuffix("/")}/commit/") buildInformationAddition.set({ BuildEnvironment = if (System.getenv("CI") != null) { "GitLabCI"