问题
I have been struggling for hours with this thing and I have spent time reading some of the suggested similar questions but couldn't find a hint or solution.
I have a build job that creates a build archive. Then I have a separate deploy job that should take that archive and copy it over ssh to a remote environment. I am using the publish over ssh Jenkins plugin. Everything seems to go well except for the copy part. No files are copied to the remote location.
I get the following:
Started by user admin
Building in workspace /usr/lib/jenkins/workspace/preprod-deploy
SSH: Connecting from host [xxxxxx]
SSH: Connecting with configuration [xxxxxx] ...
SSH: Creating session: username [xxxxxx], hostname [xxxxxx], port [22]
SSH: Connecting session ...
SSH: Connected
SSH: Opening SFTP channel ...
SSH: SFTP channel open
SSH: Connecting SFTP channel ...
SSH: Connected
SSH: cd [/var/www/test_automation]
SSH: OK
SSH: Disconnecting configuration [xxxxxx] ...
SSH: Transferred 0 file(s)
Build step 'Send files or execute commands over SSH' changed build result to SUCCESS
Finished: SUCCESS
My guess is that there is something about the way I'm trying to configure the Source Files path (The base directory for this fileset is the workspace as per the tooltip).
My build archive is located in /usr/lib/jenkins/job/build/${BUILD_TO_DEPLOY}/artifact/*zip*/archive.zip where BUILD_TO_DEPLOY in a natural number corresponding to the build job.
According to the console output, the workspace of the deploy job is /usr/lib/jenkins/workspace/preprod-deploy
This is my configuration: Ignore the exec command - that is just for testing purposes - but it works - it is successfully creating the txt file to the remote directory
Any ideas how can I overcome this?
来源:https://stackoverflow.com/questions/49615692/publish-over-ssh-plugin-cant-copy-build-archive