【发布时间】:2021-01-05 09:08:55
【问题描述】:
我正在尝试使用 Jenkins 插件“ssh publisher” - Transfer set 选项。 我想用它达到两点。 首先 - 将一些文件从 Jenkins 服务器复制到 Ansible 服务器。 其次 - 触摸 Ansible 服务器上的文件。
这是我的构建日志,清楚地表明构建工件后的 Jenkins 服务器能够 ssh 到 ansible 服务器。 然后它复制了“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
这是我的配置。
【问题讨论】:
标签: jenkins jenkins-pipeline jenkins-plugins