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/
|
||||
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
/deploy.ps1
|
||||
|
@ -8,8 +8,7 @@ job("Deploy") {
|
||||
env["SPC_USER"] = Secrets("spc-webmaster-user")
|
||||
env["SPC_ID"] = Secrets("spc-webmaster-id")
|
||||
kotlinScript { api ->
|
||||
api.gradlew("uploadDistribution")
|
||||
api.gradlew("reloadDistribution")
|
||||
api.gradle("uploadDistribution reloadDistribution")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -24,7 +23,7 @@ job("Restart service"){
|
||||
env["SPC_USER"] = Secrets("spc-webmaster-user")
|
||||
env["SPC_ID"] = Secrets("spc-webmaster-id")
|
||||
kotlinScript { api ->
|
||||
api.gradlew("reloadDistribution")
|
||||
api.gradle("reloadDistribution")
|
||||
}
|
||||
}
|
||||
}
|
@ -73,17 +73,17 @@ tasks.getByName("processResources").dependsOn(writeBuildDate)
|
||||
|
||||
/* Upload with JSch */
|
||||
|
||||
val host = System.getProperty("SPC_HOST")
|
||||
val user = System.getProperty("SPC_USER")
|
||||
val identity = System.getProperty("SPC_ID")
|
||||
val host = System.getenv("SPC_HOST")
|
||||
val user = System.getenv("SPC_USER")
|
||||
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 {
|
||||
group = "distribution"
|
||||
dependsOn("installDist")
|
||||
doLast {
|
||||
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