我想将文件从我的post build Jenkins工作区传输到远程服务器上的某个位置.对于作业中的所有步骤,构建顺利进行,但始终传输0个文件.
这是控制台输出:
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
Run Code Online (Sandbox Code Playgroud)
在将任何提交推送到GitHub之后,该作业被配置为构建
转移集是:源文件: …
我已经读过这个和这个并且这个答案但是他们没有帮助我.我正在为Jenkins使用Windows机器
我的工作区只有以下文件
C:\ Jenkins\workspace\Copy_file\DevOps\resource\file1.txt C:\ Jenkins\workspace\Copy_file\DevOps\resource\file2.txt
我想在ssh上只发布file1.txt
我将插件添加到Publish Over SSH:
Source files DevOps\resource\file1.txt
Remove prefix DevOps\resource
Remote directory /tmp/
Run Code Online (Sandbox Code Playgroud)
但是我在结果中看到:
C:\Jenkins\workspace\Copy_file\DevOps\resource\file1.txt
SSH: Connecting from host [hhhhh]
SSH: Connecting with configuration [Redhat1] ...
SSH: Creating session: username [hhhh], hostname [iiiiii], port [22]
SSH: Connecting session ...
SSH: Connected
SSH: Opening SFTP channel ...
SSH: SFTP channel open
SSH: Connecting SFTP channel ...
SSH: Connected
SSH: Remote root is not absolute, getting absolute directory from PWD …Run Code Online (Sandbox Code Playgroud)