Coder Social home page Coder Social logo

webhook's Introduction

notice

Please check this: acyortjs/site#13

webhook

构建流程图

flow

准备工作

  1. Travis Ci 的构建触发

acyortjs/site#13

  1. 获得 Travis Ci 的 api 访问 Token
# install travis
# https://github.com/travis-ci/travis.rb#installation
$ gem install travis

# login
# https://github.com/travis-ci/travis.rb#login
$ travis login

# token
# https://github.com/travis-ci/travis.rb#token
$ travis token

安装运行 webhook

需要 nodejs 环境,版本 >= 7.6.0

  1. fork 或者下载这个项目,进入文件主目录运行
npm install
  1. 生成配置文件
npm start
  1. 项目配置

修改 config.yml,填入配置信息

# 密钥设置,自定义一个特殊值,后面在项目 webhook 填入
# https://github.com/.../.../settings/hooks
secret:

# 刚刚获取的 Travis Ci token
# https://github.com/travis-ci/travis.rb#token
token:

# 准备工作阶段设置的触发 Travis Ci 构建项目
# example: travis-ci/travis-core
repository:

# 触发构建项目分支
# example: master
branch:
  1. 启动 webhook
# 默认端口 2333
node index.js [port]

你也可以使用 https://github.com/foreverjs/forever 来守护这个 nodejs 进程

配置 GitHub webhook

进入你的 issue 内容项目,选择 setting,添加一个 webhook,具体配置

  • Payload URL:填写你的 webhook 运行地址
  • Content type:选择 application/json
  • Secret:前面设置的密钥
  • Which events would you like to trigger this webhook?:选择 Let me select individual events.,然后只勾选 Issues

最后

保存你的设置,这时候当你更新 issue 时候,会触发 Travis Ci 构建,然后你的博客就自动更新了

webhook's People

Contributors

loeify avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

webhook's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.