From 2ed8586cb13caf9981da84b5c8309b70fe5038f5 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 25 May 2022 16:18:00 +0000 Subject: [PATCH 1/3] update build --- .space.kts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.space.kts b/.space.kts index 46b382e..cb554f7 100644 --- a/.space.kts +++ b/.space.kts @@ -2,10 +2,12 @@ job("Deploy") { startOn { gitPush { enabled = false } } - - gradlew("openjdk:11", "installDist") - - container(displayName = "Deploy via scp", image = "openjdk:11") { + + container(image = "openjdk:11") { + kotlinScript { api -> + api.gradlew("installDist") + } + env["HOST"] = Params("spc-host") env["USER"] = Secrets("spc-webmaster-user") env["ID"] = Secrets("spc-webmaster-id") @@ -14,8 +16,7 @@ job("Deploy") { interpreter = "/bin/bash" content = """ ls -la - """.trimIndent() + """.trimIndent() } } - } \ No newline at end of file From 98ad36d77771c39e825e5d99f67b94930f27b94b Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 25 May 2022 17:28:59 +0000 Subject: [PATCH 2/3] update CD --- .space.kts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.space.kts b/.space.kts index cb554f7..e9cc38a 100644 --- a/.space.kts +++ b/.space.kts @@ -1,22 +1,25 @@ +import circlet.pipelines.script.put + job("Deploy") { startOn { gitPush { enabled = false } } - + container(image = "openjdk:11") { kotlinScript { api -> api.gradlew("installDist") + api.fileShare().put(java.io.File("build/installDist")) } - + } + + container(image = "openjdk:11") { env["HOST"] = Params("spc-host") env["USER"] = Secrets("spc-webmaster-user") env["ID"] = Secrets("spc-webmaster-id") shellScript { interpreter = "/bin/bash" - content = """ - ls -la - """.trimIndent() + content = "echo \$ID | ssh -i /dev/stdin -r /mnt/space/share/spc-site/ \"\$USER@\$HOST:/opt\"" } } } \ No newline at end of file From 2be1e9c275cf841a2290c30f69681c79b287afe9 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 25 May 2022 17:34:17 +0000 Subject: [PATCH 3/3] update CD --- .space.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.space.kts b/.space.kts index e9cc38a..8c72259 100644 --- a/.space.kts +++ b/.space.kts @@ -8,7 +8,7 @@ job("Deploy") { container(image = "openjdk:11") { kotlinScript { api -> api.gradlew("installDist") - api.fileShare().put(java.io.File("build/installDist")) + api.fileShare().put(java.io.File("build/install")) } }