adarsh hota
adarsh hota

Reputation: 327

Download multiple files from SFTP server as a Jenkins job

I am trying to create a Jenkins job which will pull multiple files from a SFTP server to local machine.

By using ssh2easy plugin in Jenkins i am able to connect to SFTP server and pull single file as shown below.

screenshot

Upvotes: 0

Views: 8342

Answers (2)

Jan Pešta
Jan Pešta

Reputation: 794

You can use SSH2Easy plugin with following configuration in job:

  • remoteFile: /remoteFolderPath/*
  • localFolder: jobs/jobName/workspace/
  • fileName: temp/

localFolder is path to job workspace - this depends on jenkins configuration where workspace is located

fileName must end with "/" and the folder must exist in workspace.

Upvotes: 2

haschibaschi
haschibaschi

Reputation: 2792

You can use a shell build step with curl.

curl command to use:
curl --insecure sftp://username:[email protected]

Be aware that username/password have to be at the beginning of the domain name, separated by an @.

Upvotes: 0

Related Questions