Giter VIP home page Giter VIP logo

stage-ci's Introduction

stage-ci

Realtime staging environments.

Prerequisites

Node 6.6.0 and greater (security requirement for crypto.timingSafeEqual)

Development

Install project dependencies:

$ yarn

Generate a GitHub token with the repo scope. Set this token in an environment variable:

$ export GITHUB_TOKEN=123

Generate a Zeit API token and set it in an environment variable:

$ export ZEIT_API_TOKEN=123

To enable Papertrail logging, set the respective environment variables:

$ export PAPERTRAIL_HOST=logs.papertrail.com && PAPERTRAIL_PORT=1234

To inject environment variables into the staging deployment, set the ENVS environment variable to a valid JSON object:

$ export ENVS='{"REDIS_HOST": "my.cache.aws.com", "REDIS_PORT": 1234}'

Now start the server:

$ npm start

Testing GitHub integration

Install ngrok or some other localhost tunnel. Fire it up and point it to port 3000:

$ ngrok http 3000

Setup a test repo on GitHub and configure a webhook using the ngrok url. Give it access to the "Pull request" event. You also must set a secret. Use this value as your GITHUB_WEBHOOK_SECRET. It should be long and you should not share it with anyone.

Now use the same value to set your secret environment variable:

$ export GITHUB_WEBHOOK_SECRET=REPLACEME_REPLACEME_REPLACEME_REPLACEME_REPLACEME_REPLACEME_REPLACEME

Open a PR on your repo to trigger the webhook. It will also fire on commits pushed to the PR's branch.

Dev away! :)

License

stage-ci is licensed under the MIT License.

stage-ci's People

Contributors

amccloud avatar jimthedev avatar zpnk avatar

Watchers

 avatar  avatar  avatar

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.