关于 Jenkins pipeline 任务

2018-11-06 22:54:48 +08:00
 zqguo

如题,在创建 pipeline 任务的时候,因为需要部署在远程服务器,所以 jenkinsfile 应该怎么写呢?哪个语法可以连接远程 server?

2446 次点击
所在节点    问与答
3 条回复
yuikns
2018-11-07 07:46:31 +08:00
我使用的是 ssh publish

sshPublisher(
publishers: [
sshPublisherDesc(
configName: 'remote-host',
transfers: [
sshTransfer(
excludes: '',
execCommand: '''
# your commands here
''',
)
],
verbose: true
)
]
)


当然我也不太确信是不是 best practice
zqguo
2018-11-07 09:04:28 +08:00
@yuikns 先感谢,我找个时间试试。
zqguo
2018-11-07 09:28:46 +08:00
@yuikns 完全可行,非常感谢。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/505181

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX