Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Latest commit

History

History
71 lines (48 loc) 路 1.58 KB

development.md

File metadata and controls

71 lines (48 loc) 路 1.58 KB

Development

Prerequisite

  1. Make sure you have Node.js version >= 8. We recommend using version 8, the one used in CI and production.
  • To manage Node versions you can use nvm: nvm install && nvm use.
  1. Make sure you have Yarn available:
  • npm install --global yarn

Install

We recommend cloning the repository in a folder dedicated to opencollective projects.

git clone git@github.com:opencollective/opencollective-bot.git opencollective/bot
cd opencollective/bot

Dependencies are managed with Yarn. Run:

yarn install

Webhook Proxy (smee.io)

  1. Go on smee.io
  2. Start a new channel
  3. Note the Webhook Proxy URL, we will later use it as WEBHOOK_PROXY_URL

GitHub App

  1. Create a GitHub App
  • GitHub App name: Open Collective Bot (dev)
  • Homepage URL: http://github.com/opencollective/opencollective-bot
  • Webhook URL: Use your WEBHOOK_PROXY_URL from the previous step.
  • Webhook Secret: development
  • Permissions:
    • Repository contents: Read & Write
    • Issues: Read & Write
    • Pull requests: Read & Write
  • Events
    • Issues
    • Pull request
  1. Generate a private key and store it as private-key.pem in the project directory.

  2. Note the GitHub App Id, we will later use it as APP_ID

Configure environment variables

Create in the project directory an .env file with the following content:

APP_ID=<APP_ID>
WEBHOOK_SECRET=development
PRIVATE_KEY_PATH=private-key.pem
WEBHOOK_PROXY_URL=<WEBHOOK_PROXY_URL>

Start

In a terminal, run:

yarn dev