简体   繁体   English

Jenkins 插件 ssh 发布者无法将文件复制到 ansible 服务器

[英]Jenkins Plugin ssh Publisher not able to copy file to ansible server

I am trying to use Jenkins plugin " ssh publisher " - Transfer set option.我正在尝试使用 Jenkins 插件“ ssh 发布者”-传输集选项。 I want to achieve two points with it.我想用它达到两点。 firstly - copy some files from Jenkins server to Ansible Server.首先 - 将一些文件从 Jenkins 服务器复制到 Ansible 服务器。 secondly - touch a file on Ansible server.其次 - 触摸 Ansible 服务器上的文件。

Here are logs of my Build, which clearly shows that Jenkins server after building artifact, is able to ssh to ansible server.这是我的构建日志,清楚地表明 Jenkins 服务器在构建工件后能够从 ssh 到 ansible 服务器。 then it copied "0" file (Don't know why?) and finally touched file on ansible server (which is expected)然后它复制了“0”文件(不知道为什么?) ,最后触摸了 ansible 服务器上的文件(这是预期的)

[INFO] Maven Project ...................................... SUCCESS [  0.457 s]
[INFO] Server ............................................. SUCCESS [  2.408 s]
[INFO] Webapp ............................................. SUCCESS [  0.777 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.806 s
[INFO] Finished at: 2021-01-05T08:52:42Z
[INFO] ------------------------------------------------------------------------
SSH: Connecting from host [JenkinsMaster]
SSH: Connecting with configuration [ansible] ...
SSH: Creating session: username [amitadmin], hostname [ansible.amit.com], port [22]
SSH: Connecting session ...
SSH: Connected
SSH: Opening SFTP channel ...
SSH: SFTP channel open
SSH: Connecting SFTP channel ...
SSH: Connected
SSH: cd [.]
SSH: OK
SSH: Remote root is not absolute, getting absolute directory from PWD
SSH: Opening exec channel ...
SSH: EXEC: channel open
SSH: EXEC: STDOUT/STDERR from command [ touch 123.txt] ...
SSH: EXEC: connected
SSH: EXEC: completed after 201 ms
SSH: Disconnecting configuration [ansible] ...
SSH: Transferred 0 file(s)
Build step 'Send files or execute commands over SSH' changed build result to SUCCESS
Finished: SUCCESS

Here is my configuration.这是我的配置。

詹金斯的屏幕截图

I moved this step to post Build and it worked fine.我将此步骤移至发布 Build 并且效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM