Jenkins 0 files published after build

I have a Jenkins server setup with two jobs

The first work will test the development branch and build the project on the jenkins server. Then I have another job that will poll the production branch, which builds this branch on another slave jenkins, which is the intermediate server. This task is configured so that upon successful assembly it should publish artifacts on top of ssh on the production server.

All SSh keys are configured, and the intermediate server connects to the server, but 0 files are transferred

using GIT_SSH to set credentials Bitbucket Repo using .gitcredentials to set credentials Checking out Revision 89874cc01a9f669df69817b1049b1ab98ecb19d3 (origin/Production) SSH: Connecting from host [nginx-php-fastcgi] SSH: Connecting with configuration [AmazonAWS] ... SSH: Disconnecting configuration [AmazonAWS] ... SSH: Transferred 0 file(s) Finished: SUCCESS 

Jenkins is setup to use the workspace on the staging server to deploy files

I checked the intermediate workspace and files are created there that simply do not go to the prod server. Any suggestions?

I also tried a different delete prefix, as suggested below, and here Jenkins transfers 0 files using publish via SSH plugin i have also tried a different remove prefix path as suggested

+2
jenkins jenkins-plugins automated-tests jenkins-cli
source share
1 answer

You must remove /* from the Remove prefix

Edit:
Your Source files cannot be outside the workspace. If your files are located in the root directory of the workspace, simply set it * to transfer all files in the workspace or **/* to include subdirectories. Else indicates a pattern relative to ${WORKSPACE} .

Even adding the lead / will not disappear, because everything he does adds it to the workspace, in your case it becomes ${WORKSPACE}/var/www/workspace/opms-staging-server . Even using the parent directory ../ will not work. This is a security issue, otherwise the job configurator may transfer personal files from the Jenkins server.

If you need to get files from another job, you need to use the Copy artifacts step. Tell me if this is your business, and I will explain further.

+2
source share

All Articles