forked from SPC/spc-site
Fix deploy
This commit is contained in:
parent
2990e2f28f
commit
2324e9d81b
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ build/
|
|||||||
/logs/
|
/logs/
|
||||||
|
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
/deploy.ps1
|
||||||
|
@ -8,8 +8,7 @@ job("Deploy") {
|
|||||||
env["SPC_USER"] = Secrets("spc-webmaster-user")
|
env["SPC_USER"] = Secrets("spc-webmaster-user")
|
||||||
env["SPC_ID"] = Secrets("spc-webmaster-id")
|
env["SPC_ID"] = Secrets("spc-webmaster-id")
|
||||||
kotlinScript { api ->
|
kotlinScript { api ->
|
||||||
api.gradlew("uploadDistribution")
|
api.gradle("uploadDistribution reloadDistribution")
|
||||||
api.gradlew("reloadDistribution")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -24,7 +23,7 @@ job("Restart service"){
|
|||||||
env["SPC_USER"] = Secrets("spc-webmaster-user")
|
env["SPC_USER"] = Secrets("spc-webmaster-user")
|
||||||
env["SPC_ID"] = Secrets("spc-webmaster-id")
|
env["SPC_ID"] = Secrets("spc-webmaster-id")
|
||||||
kotlinScript { api ->
|
kotlinScript { api ->
|
||||||
api.gradlew("reloadDistribution")
|
api.gradle("reloadDistribution")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -73,17 +73,17 @@ tasks.getByName("processResources").dependsOn(writeBuildDate)
|
|||||||
|
|
||||||
/* Upload with JSch */
|
/* Upload with JSch */
|
||||||
|
|
||||||
val host = System.getProperty("SPC_HOST")
|
val host = System.getenv("SPC_HOST")
|
||||||
val user = System.getProperty("SPC_USER")
|
val user = System.getenv("SPC_USER")
|
||||||
val identity = System.getProperty("SPC_ID")
|
val identity = System.getenv("SPC_ID")
|
||||||
|
|
||||||
if (host != null && user != null && identity != null) {
|
if (host != null && user != null || identity != null) {
|
||||||
val uploadDistribution by tasks.creating {
|
val uploadDistribution by tasks.creating {
|
||||||
group = "distribution"
|
group = "distribution"
|
||||||
dependsOn("installDist")
|
dependsOn("installDist")
|
||||||
doLast {
|
doLast {
|
||||||
sshUploadDirectory(buildDir.resolve("install"), host, user, "/opt") {
|
sshUploadDirectory(buildDir.resolve("install"), host, user, "/opt") {
|
||||||
addIdentity("spc-webmaster.key", identity.encodeToByteArray(), null, null)
|
addIdentity("spc-webmaster", identity.encodeToByteArray(), null, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -96,4 +96,7 @@ if (host != null && user != null && identity != null) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
logger.error("Host, user or ID are not defined")
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user