scp files located outside of workspace

9 views
Skip to first unread message

t3knoid

unread,
Mar 31, 2017, 1:50:30 PM3/31/17
to Jenkins Users
Is it possible to scp files located outside of a workspace simply using existing Jenkins plugins? I am currently using a Python script to this currently by calling the scp command-line. The SCP plugin nor Publish over SSH does not appear to support this. Maybe in conjunction with another plug-in it is possible.

Maciej Jaros

unread,
Apr 3, 2017, 5:24:12 AM4/3/17
to jenkins...@googlegroups.com
t3knoid (2017-03-31 19:50):
Is it possible to scp files located outside of a workspace simply using existing Jenkins plugins? I am currently using a Python script to this currently by calling the scp command-line. The SCP plugin nor Publish over SSH does not appear to support this. Maybe in conjunction with another plug-in it is possible.

You can simply run `scp` command from shell execute step. Why would you need Python for that? You just need to configure ssh connection to whatever server you need to connect with. So basicaly you simply need to run `ssh-keygen` on your Jenkins to generate keys and `ssh-copy-id your-server` to copy key to your-server. And then...

Copy file to remote:
scp /some/local/file.sh root@your-server:/some/remote/file.sh

Copy dir from remote:
scp -r root@your-server:/some/remote/dir /some/local/dir/
Reply all
Reply to author
Forward
0 new messages