Git Product home page Git Product logo

nix-simple-ci's Introduction

nix-simple-ci

This is a very simple CI server for Nix projects on GitHub. It listens for the GitHub push webhook, builds the repo's ci.nix file in a Nix sandbox, and adds a status indicator to the commit with the GitHub API. This is particularly nice when the CI server is also a Nix binary chache, since these builds will automatically be cached for everyone else on your team.

Usage

  • Add a ci.nix file to your repo, such that nix-build ci.nix performs the CI build.

  • Generate a random key for GitHub Webhooks and add it to the Webhook UI for your repo. This is used by your server to establish trust for incoming Webhook payloads. For example:

    $ openssl rand -base64 32
  • Generate an OAuth2 token with access to the repo:status scope so that nix-simple-ci can update commit CI status on your behalf. The easiest way to do this is with personal access tokens.

  • Launch the server.

    $ nix-simple-ci --secret <webhook-shared-secret> --oauth <github-api-token> [--port <port-number>]

TODO

  • It'd be nice if the log from the nix-build were put in the target_url link of the status indicator. This would require either persisting logs on the server for later viewing, or merely posting them to a site like pastebin.
  • You can't use the statuses API to add a status to a commit on someone's fork of your repo, meaning you can't get CI status for PRs from forks. It'd be great if there were a way to do this. Maybe just build PRs and leave something like a comment?
  • Document launching the server in a systemd unit using NixOS modules.
  • Support multiple Webhook tokens via the servant-github-webhook library, and support multiple access tokens.

nix-simple-ci's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dmjio hughjfchen

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.