git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
anai1943
V2EX  ›  git

gogs git 服务器 自动发布代码到另一台服务器

  •  
  •   anai1943 · Jun 9, 2017 · 5928 views
    This topic created in 3450 days ago, the information mentioned may be changed or developed.

    在一台测试服务器 A 上搭建了 gogs,当本地提交代码到 A 服务器的仓库后,怎样实现把修改过后的文件自动同步到 B 服务器上的指定目录?

    第一次用 git,谢谢指教。

    6 replies  •  2017-06-10 17:07:04 +08:00
    rekulas
    rekulas
    Jun 9, 2017
    1
    我现在用的方法比较简单,A 库上给 B 服务器加个协作(读取)权限,然后 B 服务器通过计划任务克隆最新代码到本地,运行一切正常
    miniers
    miniers
    Jun 9, 2017
    2
    1. B 定时拉取
    2. B 搭建 webhook 来触发拉取
    miniers
    miniers
    Jun 9, 2017❤️3
    3
    https://caddyserver.com/docs/http.git
    这个可以轻松部署 webhook
    rekulas
    rekulas
    Jun 9, 2017
    4
    @miniers 不错的方法 学习了
    vinsoncou
    vinsoncou
    Jun 10, 2017
    5
    webhook 就搞定了
    KomeijiSatori
    KomeijiSatori
    Jun 10, 2017
    6
    webhook
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4523 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 03:36 · PVG 11:36 · LAX 19:36 · JFK 22:36
    ♥ Do have faith in what you're doing.