Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins transferring 0 files using publish over SSH plugin

Tags:

I want to transfer files from my post build Jenkins workspace to a location on a remote server. Build goes smoothly for all steps in the job but always transfers 0 files.

This is the console output:

    Started by user Patrick     Building in workspace /var/lib/jenkins/jobs/20eyes Build/workspace     Fetching changes from the remote Git repository     Fetching upstream changes from https://github.com/project/project.git     using .gitcredentials to set credentials     Checking out Revision a758e0f8e534271b999a2fc8696b6fd5a3d5e500 (origin/master)     executing script:      cd /var/www/20eyes-web     [SSH] exit-status: 0     SSH: Connecting from host [dev1.remotehost]     SSH: Connecting with configuration [dev2.remotehost] ...     SSH: Disconnecting configuration [dev2.remotehost] ...     SSH: Transferred 0 file(s)     Build step 'Send files or execute commands over SSH' changed build result to  SUCCESS     Finished: SUCCESS 

The job is configured to build after any commit is pushed to GitHub

The transfer set is: Source Files:

/var/lib/jenkins/jobs/20eyes Build/workspace/**/* 

Remove prefix:

/var/lib/jenkins/jobs/20eyes Build/workspace 
like image 909
whitepatrick Avatar asked Mar 03 '14 21:03

whitepatrick


People also ask

What does the publish over ssh Jenkins plugin do?

This plugin includes a builder which enables the use of the publisher during the build process. This means that you can send newly created packages to a remote server and install them, start and stop services that the build may depend on and many other use cases.

Which plugin allows to publish build artifacts via ssh?

sshPublisher : Send build artifacts over SSH. Send files or execute commands over SSH. Select to publish from the Jenkins master. The default is to publish from the server that holds the files to transfer (workspace on the agent, or artifacts directory on the master).

What is the Jenkins plugin used to connect another remote machine?

Plugin info You can use the SSH Plugin to run shell commands on a remote machine via ssh.

How do I add ssh credentials in Jenkins?

Add SSH Key inside JenkinsIn the dropdown, select 'SSH username with private key' and then give a name for it. Copy the private key from the Jenkins server. Now you can clone any git repo in this Jenkins instance. You do not need to provide the credentials while configuring the job in Jenkins.


1 Answers

I thinks, problem at your config. We have 2 positions to configure.

  1. At System configuration (Global config). --> If test ok ==> Configuration to remote server is ok.
  2. At your project. We will focus about transfer set: (Source file, Remove prefix, remote directory)

    2.1 Source file : if it's blank = workspace directory. in your case i think you should input **/*
    2.2 Remove prefix : refer Here for more info.
    2.3 Remote directory: if it's blank = directory that is configured at System configuration above.

Hope it help! Sorry about my English.

like image 79
PhungLe Avatar answered Sep 20 '22 09:09

PhungLe