In an effort to make contributing to Las Venturas Playground easier, a continuous build server is available that validates all incoming pull requests.
The server has been written using Node.js, and is designed to be modular and easy to understand, maintain and update.
In order to install the continuous integration server, clone the repository in the same directory that also has checkouts of the playground and playgroundjs-plugin repositories:
$ mkdir playground && cd playground
$ git clone https://github.com/LVPlayground/playground.git
$ git clone https://github.com/LVPlayground/playgroundjs-plugin.git
$ git clone https://github.com/LVPlayground/ci-server.git
$ git clone https://github.com/LVPlayground/server.git
$ git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"
These repositories contain the necessary Linux binaries for the basic checks to be executable.
TODO: This doesn't give us the Pawn compiler, necessary to verify that lvp.ppr builds.
Finally, copy config-example.json to config.json and change the settings to your likings. We recommend choosing a secure secret of at least 16 characters in length.
The server has been designed to work with Node.js 5.5 and beyond. Run the server using the following command:
$ nodejs index.js
In practice, you'll want to run the process in the background, using an isolated user account.
Navigate to your GitHub project's settings and create a new Webhook with the following settings:
- Payload URL: http://your.server:1234/push
- Content Type: application/json
- Secret: The secret value in your configuration file.
- Events: Only the pull_request event.
- Active: Yes.
The Webhook console will give you diagnostical output of the CI server. Please file any issues on this repository and we'll look into them.
Additionally, you'll need an account for posting the updates to GitHub that has repo:status
access
to the repositories the continuous integration will be activated for. The OAuth token, which can
be generated in GitHub's settings area, has to be written to the config file.
The continuous integration server respects the following handlers:
- /build/SHA: Build logs for the build with the given SHA.
- /build: Overview of the last ten build attempts.
- /push: Execution point for requests coming from GitHub.
- /robots.txt: Textual output to prevent indexing.