Radish alpha
r
rad:z3qg5TKmN83afz2fj9z3fQjU8vaYE
Radicle CI adapter for native CI
Radicle
Git
improve docs
Merged liw opened 1 year ago
1 file changed +36 -6 2fa4314e 161f4843
modified README.md
@@ -3,8 +3,10 @@
This is an adapter for the [Radicle CI broker], for performing CI runs
locally. This means it reads a JSON message from its stdin, and writes
two JSON messages to its stdout. Its configured via a configuration
-
file specified in the `RADICLE_NATIVE_CI` environment variable. There
-
is currently no logging.
+
file specified in the `RADICLE_NATIVE_CI` environment variable.
+

+
The adapter writes an "admin log" to its standard error output, aimed
+
at the node operator who uses Radicle CI.

The CI run is performed locally, without any isolation. This is not
safe and secure, but it's simple, and easy to get working. Do not use
@@ -31,8 +33,27 @@ rad ci
This will read `.radicle/native.yaml` and run the shell commands
specified there.

-
(No command line arguments or options needed, nor any environment
-
variables for this.)
+
Toe see `rad-ci` options, run it with the `--help` option:
+

+
~~~sh
+
$ rad-ci -- --help
+
Run the commands the Radicle native CI adapter would run for this repository.
+

+
The shell commands are specified in the .radicle/native.yaml file, in the shell field. They are run
+
directly on the host, using the Bash shell, without any isolation.
+

+
Usage: rad-ci [OPTIONS]
+

+
Options:
+
      --dry-run
+
          Don't actually run anything, merely output what would be given to Bash to run
+

+
  -h, --help
+
          Print help (see a summary with '-h')
+

+
  -V, --version
+
          Print version
+
~~~

## Architecture

@@ -54,7 +75,10 @@ The fields are:

* `base_url` --- base URL for build logs (mandatory for access from CI broker page)
* `state` --- required, directory where per-run directories are stored
-
* `log` --- required, file where native CI should write a log
+
* `log` --- required, file where native CI should write the run log
+

+
The run log is aimed at the developers of the contents of the
+
repository, instead of the node operator.


## Exit codes
@@ -89,8 +113,14 @@ cargo test
(The usual way, for a Rust program.)

Also, there is `.radicle/native.yaml` for testing this with itself in
-
Radicle CI. You may want to run those manually.
+
Radicle CI. You may want to run those manually:
+

+
~~~sh
+
yq -r .shell .radicle/native.yaml  | bash -e
+
~~~

+
(`yq` is a program like `jq`, but for YAML files. You can also
+
manually extract the `shell` field from `.radicle/native.yaml`.)

## License