-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: ssh-steps-plugin
-
None
-
Environment:Jenkins 2.501
SSH Pipeline Steps 2.0.79.v1d1b_5f76dda_8
Push "demo.txt" under the local "test-dir" to the remote "/tmp/ssh-test/". The "test-dir" directory will be created automatically. It is not possible to put "demo.txt" under the "/tmp/ssh-test/" directory.
Even if I switch the working directory to "test-dir", it still doesn't work.
Example
pipeline {
agent any
stages {
stage('Test') {
steps {
sh 'mkdir -p test-dir && echo "test" > test-dir/demo.txt' // Create local directory structure
sshPut remote: [host: 'remote-ip', user: 'user', password: 'pass'],
from: '.', into: '/tmp/ssh-test' // Transfer current directory
}
sshCommand remote: [host: 'remote-ip', user: 'user', password: 'pass'],
command: 'ls -l /tmp/ssh-test' // Verify remote path
}
}
}
}
Observed Behavior
Remote path contains local directory structure:
/tmp/ssh-test/test-dir/demo.txt
Expected Behavior
Files should be directly copied to specified into path:
/tmp/ssh-test/demo.txt