pipeline 最后一步是 通过 Publish Over SSH 插件实现远程自动部署 但是执行的内容并不会在 Jenkins 的控制台里输出( freestyle 的可以)
[Pipeline] { (远程部署)
[Pipeline] sshPublisher
SSH: Connecting from host [4f65f839a738]
SSH: Connecting with configuration [192.168.2.197] ...
SSH: EXEC: completed after 2,807 ms
SSH: Disconnecting configuration [192.168.2.197] ...
SSH: Transferred 0 file(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
1
CRUD 2021-05-06 15:55:51 +08:00
尝试把 verbose 选项设置为 true: https://wiki.jenkins.io/display/JENKINS/Publish+Over#PublishOver-Verboseoutputinconsole
``` sshPublisher( continueOnError: false, failOnError: true, publishers: [ sshPublisherDesc( configName: "${server}", verbose: true, transfers: [ ...... ] ) ] ) ``` |