2022-05-25 21:23:56 +03:00
|
|
|
import circlet.pipelines.script.put
|
|
|
|
|
2022-05-22 16:52:36 +03:00
|
|
|
job("Deploy") {
|
2022-05-25 18:40:23 +03:00
|
|
|
startOn {
|
|
|
|
gitPush { enabled = false }
|
2022-05-22 16:52:36 +03:00
|
|
|
}
|
2022-05-25 18:40:23 +03:00
|
|
|
|
2022-05-25 21:23:56 +03:00
|
|
|
container(image = "openjdk:11") {
|
|
|
|
kotlinScript { api ->
|
|
|
|
api.gradlew("installDist")
|
|
|
|
api.fileShare().put(java.io.File("build/install"))
|
|
|
|
}
|
|
|
|
}
|
2022-05-25 18:40:23 +03:00
|
|
|
|
2022-05-25 21:23:56 +03:00
|
|
|
container(image = "openjdk:11") {
|
2022-05-25 18:40:23 +03:00
|
|
|
env["HOST"] = Params("spc-host")
|
|
|
|
env["USER"] = Secrets("spc-webmaster-user")
|
|
|
|
env["ID"] = Secrets("spc-webmaster-id")
|
2022-05-22 16:52:36 +03:00
|
|
|
|
|
|
|
shellScript {
|
|
|
|
interpreter = "/bin/bash"
|
2022-05-25 21:52:55 +03:00
|
|
|
content = """
|
2022-06-01 10:47:00 +03:00
|
|
|
echo ${'$'}ID > id.key
|
2022-06-15 19:18:29 +03:00
|
|
|
chmod 400 id.key
|
2022-06-01 10:47:00 +03:00
|
|
|
scp -r -i id.key /mnt/space/share/spc-site/ "${'$'}USER@${'$'}HOST:/opt"
|
2022-05-25 21:52:55 +03:00
|
|
|
""".trimIndent()
|
2022-05-22 16:52:36 +03:00
|
|
|
}
|
|
|
|
}
|
2022-06-15 19:29:59 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
job("Restart service"){
|
|
|
|
startOn {
|
|
|
|
gitPush { enabled = false }
|
|
|
|
}
|
|
|
|
|
2022-06-15 19:44:42 +03:00
|
|
|
container(image = "openjdk:11") {
|
2022-06-15 19:29:59 +03:00
|
|
|
env["HOST"] = Params("spc-host")
|
|
|
|
env["USER"] = Secrets("spc-webmaster-user")
|
|
|
|
env["ID"] = Secrets("spc-webmaster-id")
|
|
|
|
|
|
|
|
shellScript {
|
|
|
|
interpreter = "/bin/bash"
|
|
|
|
content = """
|
2022-06-15 19:53:13 +03:00
|
|
|
echo ${'$'}ID > id_ed25519
|
|
|
|
chmod 400 id_ed25519
|
2022-06-16 09:58:17 +03:00
|
|
|
echo "$(cat id_ed25519)"
|
2022-06-15 20:37:04 +03:00
|
|
|
ssh -i id_ed25519 -o StrictHostKeyChecking=no -o HostKeyAlgorithms=ssh-ed25519 -t "${'$'}USER@${'$'}HOST" "systemctl restart sciprog-site"
|
2022-06-15 19:29:59 +03:00
|
|
|
""".trimIndent()
|
|
|
|
}
|
|
|
|
}
|
2022-05-22 16:52:36 +03:00
|
|
|
}
|