Open muyun12 opened 7 years ago
The same for me:
ssh.run {
session(remotes.mipt) {
for (f in file('target').listFiles()) {
put from: f, into: '/var/www/html', fileTransfer: 'scp'
}
}
}
Resulting in:
Host key checking is off. It may be vulnerable to man-in-the-middle attacks.
Failed SFTP MKDIR: mipt:/var/www/html/files
Failed SFTP MKDIR: mipt:/var/www/html/fonts
...
Files are still being copied.
By the way is there easier way directory content but not directory itself? The documentation is a little vague about it.
I also am running into
Failed SFTP MKDIR:
@altavir to get just the content of the directory you could do something like this:
FileTree myFileTree = fileTree(dir: 'myLocalDirectory')
ssh.run {
session(remotes.mipt) {
put from: myFileTree.getFiles(), into: '/var/www/html'
}
def remoteDir = "/home/uploader/123"
ssh.run {
[remotes.appsrv1].each {
session(it) {
execute("mkdir -p ${remoteDir}")
put from: 'build', into: remoteDir
}
}
}
result:
# gradlew deploy
> Task :online_listener:deploy FAILED
Failed SFTP MKDIR: appsrv1:build//home/uploader/123/classes
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\work\idea\erip\online_listener\build.gradle' line: 69
* What went wrong:
Execution failed for task ':online_listener:deploy'.
> org.hidetake.groovy.ssh.operation.SftpException: Failed SFTP MKDIR: appsrv1:build//home/uploader/123/classes: (SSH_FX_NO_SUCH_FILE: A reference was made to a file which does not exist): No such file
directory /home/uploader/123/build/ gets created.
but appsrv1:build//home/uploader/123/classes must be appsrv1:/home/uploader/123/build/classes
I use Gradle 5.0 on Windows.
Is this plugin supported? Bug was issued more than 2 years ago.
@lukashevich-t That error is probably a bug that was fixed in version 2.10.0 of the plugin. The plugin wasn't handling sub-directories correctly. A workaround for someone using versions prior to 2.10.0 is to use fileTransfer = scp
.
In our case, the workaround was to use fileTransfer = scp
(we were using version 2.9.0 of the plugin and Gradle 8.4).
Hi
plugin: 2.6.0
my operations ssh.run { session(remotes.syf) { put from: "${project.rootDir}/builder/${project.name}", into: '/home/syf/sshupload' } }
console tips:
Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp/grp Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp/grp/grwb Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp/grp/gspi Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp/grp/grwb Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp/grp/gspi Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp/lcm Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp/lcm/cpws Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp/lcm/tdtf Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp/lcm/tspi Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp/lcm/cpws Failed SFTP MKDIR: syf:/home/syf/sshupload/tax_settle/jsp/lcm/tdtf
but files had uploaded. why?