From 915839536e66af15e99da0228df29db3b961051f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otakar=20Hir=C5=A1?= Date: Thu, 12 Sep 2024 21:06:22 +0200 Subject: [PATCH] refactor(CD): simplify task --- backend/build.gradle.kts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index a572f9c..4b3ae7f 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -146,16 +146,7 @@ openApiGenerate { tasks.compileJava.get().dependsOn(tasks.openApiGenerate) tasks.getByName("bootBuildImage") { - // Get the tag from the environment or use the commit hash if tag is empty - val gitTag = System.getenv("GIT_TAG") - val commitHash = System.getenv("GIT_COMMIT_HASH") - - // Set the image name based on tag or commit hash - imageName = if (StringUtils.isNotBlank(gitTag)) { - "ghcr.io/${System.getenv("GITHUB_REPOSITORY")}:$gitTag" - } else { - "ghcr.io/${System.getenv("GITHUB_REPOSITORY")}:$commitHash" - } + imageName = "ghcr.io/${System.getenv("GITHUB_REPOSITORY")}:" + version publish = StringUtils.isNotBlank(System.getenv("GITHUB_TOKEN")) docker { publishRegistry { @@ -167,3 +158,4 @@ tasks.getByName("bootBuildImage") { } } +