爱意满满的作品展示区。
JustSong

写了一个简单的 webhook server

  •  
  •   JustSong ·
    songquanpeng · Nov 24, 2020 · 2236 views
    This topic created in 2001 days ago, the information mentioned may be changed or developed.

    使用场景

    比如说你有一个搭建在自己服务器上的静态网站,其内容生成自 Github 上的一个仓库中的 Markdown 文件,你想在对该仓库 commit 之后使该静态网站自动更新。

    使用方法

    1. 运行 server 。
    2. 创建好要执行的 shell 脚本(别忘了 chmod )。
    3. 运行配套的 cli 创建一个新的 webhook,其 executor 属性填入之前的脚本的路径,之后我们可以拿到一个 webhook url 。
    4. 在 Github 上的仓库设置页面设置 webhook,填入之前的拿到的 url 。
    5. 之后每当你 commit (或者你设置好的其他事件)后,Github 发送 post 请求到我们的 webhook 服务端,服务端再执行相应的 shell 脚本。

    其他

    1. 基于 Go 实现(服务端选用 Gin + Gorm )。
    2. 仓库地址: https://github.com/songquanpeng/webhook-service
    3. 更多信息详见项目的 README
    1 replies    2020-11-25 09:27:30 +08:00
    jackrebel
        1
    jackrebel  
       Nov 25, 2020   ❤️ 1
    赞一个。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1026 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 22:27 · PVG 06:27 · LAX 15:27 · JFK 18:27
    ♥ Do have faith in what you're doing.