Dennis
Dennis

Reputation: 3690

Publish over SSH Jenkins shows X files transferred, but nothing shows

I have setup Jenkins on server A with Publish over SSH to my other server B.

I have created an SSH connection between two servers using public keys. I can manually log in to server B (on server A) using "ssh [email protected]" and i can navigate to the folder I want to deploy files to and create files there (it's the jenkins user home directory).

However, when doing this step with the Publish over SSH plugin in Jenkins, the logs show me "3371 files transferred", but my home directory remains empty on server B.

These are the logs of /var/log/secure:

Jan 21 09:14:27 Server-B sshd[43388]: Accepted publickey for jenkins from 12.34.567.891 port 46548 ssh2: RSA SHA256:xxxxx
Jan 21 09:14:27 Server-B sshd[43388]: pam_unix(sshd:session): session opened for user jenkins by (uid=0)
Jan 21 09:14:52 Server-B sshd[43388]: pam_unix(sshd:session): session closed for user jenkins

The console output in Jenkins:

SSH: Connecting from host [Server B]
SSH: Connecting with configuration [Server B name] ...
SSH: Disconnecting configuration [Server B name] ...
SSH: Transferred 3371 file(s)

In Jenkins settings, I confirmed that the connection between the two servers is succesful and working via the 'Test Connection' button.

In the job I have configured the Source Files to

**/*

(the files I want to transfer are located there, cloned from git).

And my Remote directory is specified to:

/home/jenkins/test_deploy

Upvotes: 0

Views: 623

Answers (1)

Sers
Sers

Reputation: 12255

Problem is when you sent files to /home/jenkins/test_deploy jenkins used is relative path from jenkins home. Because jenkins home is /home/jenkins/ final peth becames /home/jenkins/home/jenkins/test_deploy/*.

Try ~/jenkins/home/jenkins/test_deploy/* or test_deploy/*.

Upvotes: 2

Related Questions