Giter Site home page Giter Site logo

braindead-ci's Introduction

Braindead CI

Braindead CI is a self-hosted continuous integration and deployment server written in Node.js. It can build and deploy your code automatically upon a push on Github, advertise builds on Hipchat and do that quickly and painlessly.

What does it look like?

Dashboard

What can it do?

  • Automatic build and deploy on a push to the Github repository
  • Advertise build results on Hipchat
  • Very fast (starts up in less than a second, page load typically less than 500ms)
  • Easy to set up (create a job in 1 minute, set up hook to Github and Hipchat in 2)
  • All-purpose: can build and deploy any type of project, whatever the technology used is
  • Smart support for Node.js projects (only reinstall dependencies if needed to gain time). Smart support for other platforms will come depending on use (if you need it for your stack, do submit an issue, or even better a PR!)

Installation and tests

This assume you already have Node.js installed on your system.

// Install Braindead in two commands
git clone git@github.com:louischatriot/braindead-ci.git
npm install

// Now test it (dev dependencies need to be installed)
make test

// You're done, now launch it:
./braindead              // On default port (2008)
./braindead.js -p 2009   // On port 2009

// Check out possible command-line options
./braindead.js -h

In production

It's highly recommended to serve Braindead over HTTPS (with Nginx for example). Upon first launch you will create your first admin user (you can create others in the settings), and then you'll need to be logged in to do anything.

The path to Braindead's home page should be / (corresponding to a URL such as https://ci.example.com/ or https://example.com:2008/). I will add an option for other URL structures in the future if enough people ask for it though.

Hooking up Braindead and Github

1. Braindead provides a URL, /githubwebhook, that Github can use POST to everytime a push occurs on the repo. In order to only allow Github to trigger builds on Braindead, you need to first create a token for Github in Braindead's Third-party services settings:

Github token

2. Then, you set up a WebHook on your Github repo ("Settings", "Service hooks"), using the /githubwebhook URL and the same token you defined in step 1 as the "token" querystring parameter like this:

Github webhook

Hooking up Braindead and Hipchat

In the third-party services settings, enter your Hipchat API token and the name of the room you want Braindead to tell you build results. You can also specify the "Braindead root url" which is the url of the home page (e.g. https://ci.example.com), so that the messages in Hipchat contain links to the build results.

Once set, you will be notified whenever a job was built (or skipped if disabled), and Hipchat will alert you in case the build fails.

Going forward

We've been using Braindead CI for a few months at tldr.io and it works very well (for our needs at least). That said, this is just the first release to the outside so some bolts may need tightening. Also, we will certainly need to expand the "smart builds" behavior for Node.js projects to other platforms, and enable build advertising on other channels than Hipchat. Don't hesitate to submit issues or pull requests!

License

MIT. Do whatever you want with the code.
(c) 2013 Louis Chatriot, [email protected]

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.