forked from SPC/spc-site
Fix directory name in deploy
This commit is contained in:
parent
3a25c37a47
commit
fa9c042c75
@ -82,7 +82,7 @@ if (host != null && user != null || identity != null) {
|
|||||||
group = "distribution"
|
group = "distribution"
|
||||||
dependsOn("installDist")
|
dependsOn("installDist")
|
||||||
doLast {
|
doLast {
|
||||||
sshUploadDirectory(buildDir.resolve("install"), host, user, "/opt") {
|
sshUploadDirectory(buildDir.resolve("install/spc-site"), host, user, "/opt") {
|
||||||
addIdentity("spc-webmaster", identity.encodeToByteArray(), null, null)
|
addIdentity("spc-webmaster", identity.encodeToByteArray(), null, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,16 +25,18 @@ private fun ChannelSftp.recursiveFolderUpload(sourceFile: File, destinationPath:
|
|||||||
cd(destinationPath)
|
cd(destinationPath)
|
||||||
var attrs: SftpATTRS? = null
|
var attrs: SftpATTRS? = null
|
||||||
// check if the directory is already existing
|
// check if the directory is already existing
|
||||||
|
val directoryPath = destinationPath + "/" + sourceFile.getName()
|
||||||
try {
|
try {
|
||||||
attrs = stat(destinationPath + "/" + sourceFile.getName())
|
attrs = stat(directoryPath)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
println(destinationPath + "/" + sourceFile.getName() + " not found")
|
println("$directoryPath does not exist")
|
||||||
}
|
}
|
||||||
|
|
||||||
// else create a directory
|
// else create a directory
|
||||||
if (attrs != null) {
|
if (attrs != null) {
|
||||||
println("Directory exists IsDir=" + attrs.isDir())
|
println("Directory $directoryPath exists IsDir=${attrs.isDir()}")
|
||||||
} else {
|
} else {
|
||||||
println("Creating dir " + sourceFile.getName())
|
println("Creating directory $directoryPath")
|
||||||
mkdir(sourceFile.getName())
|
mkdir(sourceFile.getName())
|
||||||
}
|
}
|
||||||
for (f in files) {
|
for (f in files) {
|
||||||
|
Loading…
Reference in New Issue
Block a user