summaryrefslogtreecommitdiff
path: root/README.md
blob: ba2cae0a5f488db6b858c2307d2dbd666505bac7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# radicle-ci-broker

This is not production ready code yet, but it will eventually become a
thing that listens for changes in a Radicle node, and triggers CI on
the relevant ones.

## Architecture

See the `doc` directory for architecture documentation.

## Binaries

The crate contains several binaries:

* `ci-broker` --- the actual CI broker
  - this is probably the only one you need to care about
* `broker-messages`  --- helper program to print sample messages
  between the broker and adapters
* `filter-events` --- a helper program to see what events a CI broker
  config allows
* `list_runs` --- list all CI runs in a broker database
* `pagegen` -- helper program to produce sample report pages
  - mostly only useful for testing changes to the page generating code

## Packaging

There is simple, simplistic, rudimentary, personal-use-only packaging
for Debian in the `debian` directory, used by Lars to build packages
for his own use.

## Running tests

To run the test suite for the CI broker:

~~~sh
cargo test
~~~

(As usual, for a Rust program.)

## Configuration

The configuration file is named on the command line. It is a YAML
file, for example:

~~~yaml
default_adapter: native
db: radicle-native-ci.sqlite
adapters:
  native:
    command: radicle-native-ci
    env:
      RADICLE_NATIVE_CI: /home/liw/radicle/radicle-native-ci/x/config.yaml
filters:
  - !And
    - !Repository "rad:z2e6URdt1we1iG1BCVqtx8QVgsX4a"
    - !Or
      - !Branch "main"
      - !AnyPatchRef
~~~

OR if you only want to filter for patch COB updates (e.g. comments), to the specified repository:

~~~yaml
default_adapter: native
db: radicle-native-ci.sqlite
adapters:
  native:
    command: radicle-native-ci
    env:
      RADICLE_NATIVE_CI: /home/liw/radicle/radicle-native-ci/x/config.yaml
filters:
  - !And
    - !Repository "rad:z2e6URdt1we1iG1BCVqtx8QVgsX4a"
    - !And
      - !AnyPatch
      - !Not 
        - !AnyPatchRef 
~~~

This runs the native CI engine as an adapter, on any repository events
that pass the filter. The filter allows any changes to the `main`
branch or any Radicle patch, on the specified repository.