项目作者: mlenkeit

项目描述 :
Deploy After Build (DAB) - Continuous Deployment for your Raspberry Pi
高级语言: JavaScript
项目地址: git://github.com/mlenkeit/pi-dab.git
创建时间: 2017-08-31T17:46:42Z
项目社区:https://github.com/mlenkeit/pi-dab

开源协议:MIT License

下载


pi-dab

Build Status Greenkeeper badge

Deploy After Build (DAB) - Continuous Deployment for your Raspberry Pi

pi-dab ensures that when a project is successfully built with Travis CI, that this code is also checked out onto your Raspberry Pi and started. It runs on your Raspberry Pi in the background and uses localtunnel to expose itself to GitHub via webhooks of configured repositories, so you don’t need to mess with network settings.

Installation It

  1. git clone https://github.com/mlenkeit/pi-dab.git
  2. cd pi-dab
  3. npm install --production

Run It

  1. GITHUB_TOKEN=<GITHUB_TOKEN> \ # see config
  2. GITHUB_USER=<GITHUB_USER> \
  3. PORT=5000 \
  4. PROJECTS=<FILEPATH_TO_PROJECTS> \ # see config
  5. npm test

Configure It

GitHub Token

pi-dab needs a GitHub token to set up the GitHub webhooks. Follow the Create a personal access token and grant permission for admin:repo_hook.

You need to pass this token to pi-dab in the environment variable GITHUB_TOKEN.

Projects

For each project that pi-dab should listen to, you can configure:

  • name: the GitHub repo name including user/organization: <user>/<repo>
  • dir: the directory on your pi where the project is located at
  • githubWebhook: the id of the GitHub webhook that pi-dab should use
  • postCheckoutScript: the commands that are executed after checkout. The cwd is dir, so can you e.g. run npm install --production.

Example:

  1. module.exports = [{
  2. name: 'mlenkeit/pi-dab',
  3. dir: '/home/pi/pi-dab',
  4. githubWebhook: 1234,
  5. postCheckoutScript: 'npm install --production'
  6. }];