GithubHelp home page GithubHelp logo

alexxnica / ofborg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nixos/ofborg

0.0 1.0 0.0 280 KB

@grahamcofborg tooling automation

License: MIT License

Nix 57.00% Rust 32.59% Shell 0.13% PHP 10.27%

ofborg's Introduction

grahamcofborg

Guidelines

  1. make sure you've reviewed the code before you trigger it on a PR that isn't your own
  2. be gentle, preferably don't run mass rebuilds / massive builds like chromium on it

Commands

  1. To trigger the bot, the comment must start with a case insensitive version of @GrahamcOfBorg.
  2. To use multiple commands, insert a bit of whitespace and then your new command.

Commands:

test (added: 2017-11-24)

@grahamcofborg test list of tests

This will run nix-build ./nixos/release.nix -A tests.list -A tests.of -A tests.attrs in the nixpkgs checkout. Note: this will only run on x86_64-linux machines.

eval

@grahamcofborg eval

Note: Every PR automatically evaluates when it is opened and when the commits change. There is no reason to run eval on a PR unless the evaluation has failed for weird reasons, or because master was broken before.

build

@grahamcofborg build list of attrs

This will run nix-build ./default.nix -A list -A of -A attrs in the nixpkgs checkout.


Multiple Commands:

@grahamcofborg build list of attrs
@grahamcofborg eval

or even:

@grahamcofborg build list of attrs @grahamcofborg eval

This will not work:

looks good to me!
@grahamcofborg build list of attrs

Also this is bad:

@grahamcofborg build list of attrs
looks good to me!

as it'll try to build list of attrs looks good to me!.

arch

  1. All github events go in to web/index.php, which sends the event to an exchange named for the full name of the repo (ex: nixos/nixpkgs) in lower case. The exchange is set to "fanout"
  2. build-filter.php creates a queue called build-inputs and binds it to the nixos/nixpkgs exchange. It also creates an exchange, build-jobs, set to fan out. It listens for messages on the build-inputs queue. Issue comments from authorized users on PRs get tokenized and turned in to build instructions. These jobs are then written to the build-jobs exchange.
  3. builder.php creates a queue called build-inputs-x86_64-linux, and binds it to the build-jobs exchange. It then listens for build instructions on the build-inputs-x86_64-linux queue. For each job, it uses nix-build to run the build instructions. The status result (pass/fail) and the last ten lines of output are then placed in to the build-results queue.
  4. poster.php declares the build-results queue, and listens for messages on it. It posts the build status and text output on the PR the build is from.

Getting Started

  • you'll need to create the WORKING_DIR
  • nix-shell
  • composer install
  • php builder.php

The conspicuously missing config.php looks like:

<?php

require_once __DIR__ . '/vendor/autoload.php';
use PhpAmqpLib\Connection\AMQPSSLConnection;
use PhpAmqpLib\Message\AMQPMessage;

define("NIX_SYSTEM", "x86_64-linux");
define("WORKING_DIR", "/home/grahamc/.nix-test");

function rabbitmq_conn() {
    $connection = new AMQPSSLConnection(
        'events.nix.gsc.io', 5671,
        eventsuser, eventspasswordd, '/', array(
            'verify_peer' => true,
            'verify_peer_name' => true,
            'peer_name' => 'events.nix.gsc.io',
            'verify_depth' => 10,
            'ca_file' => '/etc/ssl/certs/ca-certificates.crt'
        )
    );

    return $connection;
}

/*
# Only leader machines (ie: graham's) need this:
function gh_client() {
    $client = new \Github\Client();
    $client->authenticate('githubusername',
                          'githubpassword',
                          Github\Client::AUTH_HTTP_PASSWORD);

    return $client;
}
*/

Getting started on the rust one...

nix-shell ./shell.nix -A rustEnv
$ cd ofborg
$ cargo build
cargo build

then copy example.config.json to config.json and edit its vars. Set nix.remote to an empty string if you're not using the daemon.

Run

./target/debug/builder ./config.json

ofborg's People

Contributors

grahamc avatar mic92 avatar lheckemann avatar adisbladis avatar

Watchers

 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.