Xbus Fullenv
xbus-fullenv is a command line tool that can setup xbusd, xbusctl and xbus-client(s) in a single operation, based on single configuration file.
It is aimed at setting up development and tests environments without going through all the steps manually, making it easy to reproduce a given setup.
xbus-fullenv
Usage
xbus-fullenv <command> [ --target dir ] [ --dsn dsn ] configurationfile
Options
- configurationfile
A yaml file path. The file content is documented below.
- --dsn dsn
Set the database dsn. Will override the dsn present in the configuration file.
- --target dir
Target directory path. If omitted, a directory is created in the TEMPDIR.
- --debug
Enable debug mode
- --trace
Enable trace mode
- --no-prompt
In interactive mode, disable the ‘>’ prompt. Useful for controling the fullenv from another program.
Commands
setup
Setup the server and clients in the target directory.
Usage:
run
Setup the server and clients in the target directory, then opens an interactive mini-shell.
The available commands are:
- client-config <name>
returns the configuration path of a client
- wd
returns the environment work directory
- startup
start the clients
- shutdown
shutdown the clients
- quit
shutdown everything and quit
help, ?
Inline help
Usage:
Configuration file
The configuration file is a yaml file composed of a few top-level keys:
xbusd
A xbusd configuration file content, that can be empty.
If the database settings are not given, they are copied from either the
command line flag --dsn
, or the environment variable
XBUS_TEST_POSTGRES_DSN
.
Example:
xbusd:
database:
dsn: dbname=xbus user=xbus password=xbus sslmode=disable
clients
A list of xbus-client configurations. These clients will be automatically registered along with their actors.
Extra attributes can be added to each client settings:
- autostart
If set to false, the client will not be started by the ‘startup’ command.
- custom-xbus-client
If set, the program will be used instead of ‘xbus-client serve’ to start the client.
Example:
clients:
- account-name: test-emitter
autostart: false
actors:
"0":
name: test-emitter
kind: emitter
status: enabled
roles: [tester]
- account-name: test-consumer
autostart: true
actors:
"0":
name: test-consumer
kind: consumer
status: enabled
roles: [tester]
service:
type: demo.print-to-console
ctl
Same as ‘clients’, but for user account definitions.
Example:
ctl:
- account-name: admin
password: PASSWORD
http
Same as ‘clients’, but for http gateway(s).
Example:
http:
- account-name: gw
autostart: true
pipelines
A dictionary of pipeline definitions.
The key format is the following:
<name>[-<version>][#<status>]
Where <status>
can be draft
, active
or inactive
.
Example:
pipelines:
defaultpipeline-v1#active:
nodes:
- id: source
type: emitter
roles: [tester]
rolebroadcast: true
sourcematch:
eventtypes:
- demo.msg
outputs:
- default
- id: sink
type: consumer
roles:
- tester
rolebroadcast: true
inputs:
- default
edges:
- source -> sink