Running the CLI in Docker
The CLI is published as a public image, so an installation can be checked from any machine with Docker and no Python of its own. It is the same bruce command described in Getting started, as the image's entrypoint.
latest follows the newest release. Every release is also tagged with the library version it contains, which is what to pin in CI so a run is repeatable.
Giving it credentials
The image holds no configuration, so settings come in per run. An env file is the usual way, and it keeps the token off the command line and out of the shell history.
Pass it with --env-file. Note this is Docker's own flag reading the file into the container's environment, which is not the same as the CLI's --env-file option, though the file format is the same.
Individual variables work too, for a CI runner that already holds them as secrets.
Running the core tests
This is the check worth wiring into a pipeline: run the core suite against a Hosting Location, which builds a temporary Account, exercises the journeys and removes it afterwards. It proves the installation works rather than proving one account's data does.
Against a specific Account instead, which tests in the data that is already there:
core is the tag covering the CSV, BRZ, GeoJSON and historic/Scenario journeys. Swap it for all to include the assembly alignment and scale tests, or for a number, list or range to run one thing. bruce test on its own lists what a credential can run.
The command exits non-zero when a test fails, so a pipeline step needs nothing else to gate on it.
Things worth knowing
The container runs as a non-root user (UID 10001) with its home at /home/bruce. Nothing is written outside it, and --rm means a run leaves nothing behind at all.
Nothing is stored between runs. There is no bruce login to do first, because the container is gone afterwards. Mount a config directory at /home/bruce/.config if you want a login to persist across runs.
A private installation needs its urls. The environment name only implies a host for Nextspace-hosted environments. Set NXT_GUARDIAN_URL, and NXT_BASE_URL if the Account lookup should be skipped, otherwise the lookup goes to the public Guardian and resolves nothing.
Test data is real data. The tests create Entity Types, files and Entities in whatever they are pointed at, and clean up after themselves. Point them at a Hosting Location or a test Account rather than at production.