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

请教:通过 Github 自动化部署运行服务

  •  
  •   KeatingSmith · 2018-09-21 15:43:36 +08:00 · 1663 次点击
    这是一个创建于 2015 天前的主题,其中的信息可能已经有所发展或是发生改变。

    有这样一种场景,develop 分支合并或者修改了代码。

    服务器端怎么能够检测到,并且自动拉取部署?

    8 条回复    2018-09-22 15:29:46 +08:00
    FakeLeung
        1
    FakeLeung  
       2018-09-21 15:47:19 +08:00   ❤️ 1
    目前用的 gitlab/github 的 webhook。推送后,通知 jenkins 去「部署」(其实就是拉取然后 ssh / scp 罢了。并不知道其他高级用法)
    ech0x
        2
    ech0x  
       2018-09-21 15:48:42 +08:00   ❤️ 1
    Github hook 吧......
    KeatingSmith
        3
    KeatingSmith  
    OP
       2018-09-21 15:49:42 +08:00
    @FakeLeung

    目前有一种办法,是通过 systemd 运行一个监听脚本,检测到分支变化,就主动执行某些操作。

    但是想问一下有没有更好的方案。
    FakeLeung
        4
    FakeLeung  
       2018-09-21 15:50:49 +08:00
    @KeatingSmith
    那还不如直接 webhook。
    isCyan
        5
    isCyan  
       2018-09-21 15:59:41 +08:00 via Android   ❤️ 1
    webhook
    https://github.com/adnanh/webhook
    结合这个再写个部署脚本就可以了
    gmykissqiqi
        6
    gmykissqiqi  
       2018-09-21 17:23:38 +08:00
    webhooks 啊
    maichael
        7
    maichael  
       2018-09-21 17:42:34 +08:00
    Travis-CI
    lengyihan
        8
    lengyihan  
       2018-09-22 15:29:46 +08:00 via Android
    netlify 也行
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   951 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:18 · PVG 05:18 · LAX 14:18 · JFK 17:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.