Name: micro-ci
Owner: servant
Description: A tiny CI server built around GitHub and Nix
Forked from: ocharles/micro-ci
Created: 2017-11-28 08:59:52.0
Updated: 2017-11-28 08:59:54.0
Pushed: 2017-11-28 17:49:09.0
Homepage: null
Size: 97
Language: Haskell
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Hello, thanks for checking out micro-ci
.
micro-ci
is a tiny continuous integration server, that tries to do
very little. By this, we mean off loading as much logic as possible to
other systems. In particular, this continuous integration server
only supports GitHub and Nix.
This project is in its infancy, but if you'd like to play along at home, here's how.
Get an OAuth token.
Navigate to https://github.com/settings/tokens and generate a new
OAuth token. It only needs the repo:status
permission.
Add the webhook.
Go to https://github.com/$YOUR_NAME/$YOUR_REPO/settings/hooks,
changing $YOUR_NAME
and $YOUR_REPO
appropriately. Add a webhook
with a URL of the format: http://$PUBLIC_HOST:8080/github/web-hook
,
where $PUBLIC_HOST
is the publically accessible host of the
server that will be running your builds.
Set:
Content type: application/json
Secret: (anything you want)
Which events: at least “pull request”, but you can also just use “everything”.
Configure the server.
In the directory you plan to run micro-ci
from, you'll need a
config.dhall
file. A template is:
poRoot = "repositories",
cret = ...,
uth = ...
Fill in oauth
and secret
according to values previously retrieved/entered.
Run the server.
On the machine that will run the builds, run
build ci.nix -A micro-ci
sult/bin/micro-ci
Add a ci.nix
file to your project.
Finally, write a ci.nix
file in your project. This Nix
expression should evaluate to an attribute-set of derivations.
For example, a Haskell project could use:
(import <nixpkgs> {});
bal-build = haskellPackages.callPackage ./default.nix {};
But you can be as clever as you want. All that micro-ci
cares
about is if the derivation can be evaluated.
Optional: Add status checks
Open a pull request to check that everything works. If it looks
good, you can enforce micro-ci
to pass all jobs. Head to
https://github.com/$YOUR_NAME/$YOUR_REPO/settings/branches and set
up a protected branch and add the ci.nix
statuses.