From 5e1625d98cb297ea850d7acd7c12115d190fca5d Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 15 Jun 2022 16:29:59 +0000 Subject: [PATCH] Update CD --- .space.kts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.space.kts b/.space.kts index 831d3a1..05a9e92 100644 --- a/.space.kts +++ b/.space.kts @@ -26,4 +26,25 @@ job("Deploy") { """.trimIndent() } } +} + +job("Restart service"){ + startOn { + gitPush { enabled = false } + } + + 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 = """ + echo ${'$'}ID > id.key + chmod 400 id.key + ssh -i id.key -t "${'$'}USER@${'$'}HOST" "systemctl restart sciprog-site" + """.trimIndent() + } + } } \ No newline at end of file