zqguo
V2EX  ›  问与答

关于 Jenkins pipeline 任务

  •  
  •   zqguo · Nov 6, 2018 · 2903 views
    This topic created in 2771 days ago, the information mentioned may be changed or developed.

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

    3 replies    2018-11-07 09:28:46 +08:00
    yuikns
        1
    yuikns  
       Nov 7, 2018
    我使用的是 ssh publish

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


    当然我也不太确信是不是 best practice
    zqguo
        2
    zqguo  
    OP
       Nov 7, 2018
    @yuikns 先感谢,我找个时间试试。
    zqguo
        3
    zqguo  
    OP
       Nov 7, 2018
    @yuikns 完全可行,非常感谢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2671 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 15:48 · PVG 23:48 · LAX 08:48 · JFK 11:48
    ♥ Do have faith in what you're doing.