From 3565a03d57c282e6abf174b2547a68e4e7dea9a0 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 10 Jul 2022 12:58:51 +0300 Subject: [PATCH] Update deploy script --- .space.kts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.space.kts b/.space.kts index 5429d6b..57ddb47 100644 --- a/.space.kts +++ b/.space.kts @@ -16,15 +16,19 @@ job("Publish"){ api.space().projects.automation.deployments.start( project = api.projectIdentifier(), targetIdentifier = TargetIdentifier.Key("gradle-tools"), - version = "current", + version = api.gitRevision(), // automatically update deployment status based on a status of a job syncWithAutomationJob = true ) - api.gradlew( - "publishAllPublicationsToSpaceRepository", - "-Ppublishing.space.user=\"$spaceUser\"", - "-Ppublishing.space.token=\"$spaceToken\"", - ) + try { + api.gradlew( + "publishAllPublicationsToSpaceRepository", + "-Ppublishing.space.user=\"$spaceUser\"", + "-Ppublishing.space.token=\"$spaceToken\"", + ) + } catch (ex: Exception) { + println("Publish failed") + } } } }