V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zqguo
V2EX  ›  问与答

关于 Jenkins pipeline 任务

  •  
  •   zqguo · 2018-11-06 22:54:48 +08:00 · 2423 次点击
    这是一个创建于 1968 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    3 条回复    2018-11-07 09:28:46 +08:00
    yuikns
        1
    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
        2
    zqguo  
    OP
       2018-11-07 09:04:28 +08:00
    @yuikns 先感谢,我找个时间试试。
    zqguo
        3
    zqguo  
    OP
       2018-11-07 09:28:46 +08:00
    @yuikns 完全可行,非常感谢。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3245 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:10 · PVG 21:10 · LAX 06:10 · JFK 09:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.