generated from kotlingang/kotlin-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
58 lines (48 loc) · 1.71 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import me.y9san9.deploy.ssh
import org.jetbrains.kotlin.konan.properties.loadProperties
plugins {
id(Deps.Plugins.Configuration.Kotlin.Jvm)
}
group = AppInfo.PACKAGE
version = AppInfo.VERSION
allprojects {
repositories {
mavenCentral()
}
}
dependencies {
implementation(project(Deps.Projects.Bot))
implementation(project(Deps.Projects.CatgifsCataas))
implementation(project(Deps.Projects.CatgifsFromCache))
implementation(project(Deps.Projects.DbMigrations))
implementation(Deps.Libs.Slf4j.Simple)
implementation(Deps.Libs.Exposed.Core)
implementation(Deps.Libs.Exposed.Jdbc)
implementation(Deps.Libs.InMo.TgBotApi)
}
val deployPropertiesFile = file("deploy.properties")
if(deployPropertiesFile.exists()) {
val properties = loadProperties(deployPropertiesFile.absolutePath)
project.apply<me.y9san9.deploy.Deploy>()
project.configure<me.y9san9.deploy.DeployConfiguration> {
serviceName = "catbot"
implementationTitle = "catbot"
mainClassName = "me.y9san9.catbot.MainKt"
host = properties.getProperty("host")
user = properties.getProperty("user")
password = properties.getProperty("password")
deployPath = properties.getProperty("deployPath")
// On linux should be something like /home/user/.ssh/known_hosts
// Or Default Allow Any Hosts if this value is not specified,
// But then MITM may be performed
knownHostsFile = properties.getProperty("knownHosts")
}
task("stop") {
group = "deploy"
doLast {
project.ssh {
execute("systemctl stop ${project.the<me.y9san9.deploy.DeployConfiguration>().serviceName}")
}
}
}
}