Local stack and database
The robotelos commands that run a local instance with Docker (dev) and manage PostgreSQL migrations (db).
Local stack: dev
robotelos dev runs a complete instance on your machine for testing. It needs Docker.
| Command | What it does |
|---|---|
robotelos dev doctor | Checks Docker, the config file, the state folder and the ports. Lists every failure. Exit code 1 if anything fails. |
robotelos dev up | Starts PostgreSQL in Docker, applies the migrations and runs the gateway. Ctrl-C stops the gateway and keeps the database. |
robotelos dev status | Shows the state of the database container. |
robotelos dev down | Removes the database container. Add --volumes to delete its data too. |
dev up accepts these flags:
| Flag | Default | Meaning |
|---|---|---|
-http | 127.0.0.1:8787 | HTTP address of the gateway (SSE and WebSocket) |
-grpc | 127.0.0.1:8788 | gRPC address; off disables it |
-postgres-port | 5433 | Host port for PostgreSQL |
-context-name | dev | Name of the context that dev up registers and makes current |
The token for the local instance is written to ~/.robotelos/dev/token. The generated secrets are kept in ~/.robotelos/dev/state.json, readable by you only.
Database: db migrate
| Command | What it does |
|---|---|
robotelos db migrate status | Lists each migration as applied, pending or changed. |
robotelos db migrate up | Applies the pending migrations. Refuses if an applied file has changed. |
robotelos db migrate up --dry-run | Runs the pending migrations in a transaction and rolls it back, so you can check them. |
robotelos db migrate new NAME --dir CHAIN | Creates an empty, timestamped migration file in the chain you name (db/migrations, db/control/migrations or db/data/migrations). |
robotelos db rotate-epoch --yes | After the control database was restored to an earlier point, starts a new epoch of its desired state, so that every fleet takes the snapshot it is given next whatever its revision. Reads ROBOTELOS_DATABASE_URL, the control database. |
robotelos db migrate repair --status applied|reverted --yes VERSION | Fixes the version table after a manual change. Runs no SQL; refuses a changed file. |
up, status and --dry-run read the database address from ROBOTELOS_DATABASE_URL. This keeps the password out of the command line. Use --dir or ROBOTELOS_MIGRATIONS_DIR to choose another migrations folder.
Next steps
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.