Skip to content

Deploy from a repository

Start by installing the CLI and signing in. Then pick the path that matches what you have.

Two commands do different things, and it is worth knowing which one you are running:

  • A single folder’s push — ronja wf push, ronja app push and the others — sends the folder to your own draft. Nobody else sees it until you publish it. ronja automation push is the exception: an automation has no draft, so its push changes the live automation at once.
  • ronja sync apply pushes and publishes every folder under the directory it runs in. What it deploys is live as soon as it finishes.

An AI coding assistant, such as Claude Code or Codex, working in the repository with your sign-in should not put changes live on its own. It runs ronja propose instead:

Terminal window
ronja propose

ronja propose changes nothing in Ronja. It works out what ronja sync apply --allow-create would create and change, and which migrations a managed database folder would apply, then uploads that list with a copy of the files as a change list, and prints a link. You, the person whose sign-in the assistant uses, get a notification, check the list in Ronja and click Approve and deploy. Ronja then deploys that exact copy as you; the assistant never deploys. See Approve a change list.

It refuses, and uploads nothing, when:

  • a folder is not adopted. Ronja has to keep the record of what each folder deploys, so a deploy can never create the same thing twice: run ronja sync adopt --stack <name> once (see Adopt a repository you already deploy from).
  • a folder would not deploy cleanly. It prints the same reason ronja sync apply --dry-run gives.
  • a database migration was changed after it was applied. Add a new migration instead of editing one that has run.
  • a folder names, by address, a folder outside the directory proposed, so the copy would not hold it. Propose from a directory that holds both.

ronja sync apply is the direct deploy, with no approval: for a build server, and for you deploying by hand.

For a quick change to one workflow, App, module or Feature’s tables, with no repository set up:

  1. Copy it into a folder: ronja wf clone <workflow ID>, then go into the folder it names.
  2. Edit the files in your own editor.
  3. Run ronja wf push to send them to your draft.
  4. Run ronja wf test to run the draft and see its result.
  5. Run ronja wf publish to take it live.

Apps work the same way with ronja app. Modules (ronja module clone <module ID>) and a Feature’s tables (ronja pipeline clone <Feature ID>) use clone, push and publish, with no test step. See Work on Ronja from your editor.

Adopt a repository you already deploy from

Section titled “Adopt a repository you already deploy from”

If you already push folders from a repository, let Ronja keep the record of what each one deploys, so a build server needs nothing committed by hand. Each folder must already name the stack in ronja.json, with its Feature’s ID as featureID; a folder that does not is reported no_feature and left unchanged.

  1. Run ronja sync adopt --stack prod at the top of the repository.
  2. Commit the changed ronja.json files.
  3. Run ronja sync apply --stack prod --dry-run to see what a deploy would do, then ronja sync apply --stack prod.

Once adopted, a folder writes and runs only inside its stack’s Feature. A workflow that writes a table in another Feature, or runs a workflow or Saved Agent there, is refused (writes_outside_target, runs_outside_target) until that dependency is declared in ronja.json with "write": true or "run": true and set in the stack’s bind map.

Running ronja sync adopt again is safe. To stop a folder keeping its records in Ronja, run ronja sync unmanage.

To start a repository from what a Feature already holds:

Terminal window
mkdir sales && cd sales && git init
ronja import feature Sales # the Feature's folders, on stack "main"
git add -A && git commit -m "Import Sales"
ronja sync status --stack main # clean: the tree holds what is live
# edit files, commit, then:
ronja sync apply --stack main --dry-run # what the deploy would change
ronja sync apply --stack main # push and publish every changed folder

In the dry run, everything that already matches what is live is listed as unchanged — a workflow, App or module folder, and each table, metric and automation file — and the deploy changes nothing for it. (If Ronja has no record yet of a row the folder’s ronja.lock.json names, the dry run says the deploy adds that record; that changes nothing you deployed.) If someone changes something in Ronja that the repository deploys, the next deploy stops and names it; run ronja <kind> pull to take the change into the folder, and commit it.

An import names what each folder reads by the folder that builds it where it can, so the same repository can deploy elsewhere. It leaves two kinds of ID in place and lists them: a table a workflow’s code replaces by its ID, and IDs written into an App’s source. Before deploying to a second stack, change the App’s IDs by hand; ronja sync stack add turns each tools.replaceTable(df, "table-…") it lists into tools.replaceTable(df, {{ write('<name>') }}) for you. To import only part of a Feature, such as one app and what it needs, use ronja import feature --only <ID>: see Test in a dev Space. Letting Ronja keep the records of tables and metrics needs an Admin, so anyone else’s import writes no pipeline folder and lists the tables and metrics it left out.

A second stack — a test Feature next to production, say — deploys the same repository somewhere else, from the same checkout: each stack keeps its own record of what it last deployed. A module’s name is unique within a Feature, so a stack can deploy its own copy of a module into its own Feature, or deploy to the Feature the module already lives in and share that copy. For a test stack in a dev Space of the same organization, see Test in a dev Space.

From the same checkout:

  1. Run ronja sync stack add <name> --feature <the second Feature's ID> at the top of the repository. It adds the stack to every folder’s ronja.json, next to main, and creates nothing in Ronja. Under the same confirmation, it turns every ID written into the code into a name the folder declares, kept pointing at the same row for main, so main reads and writes the same rows. A table the code replaces by its ID becomes {{ write('<name>') }}: main still writes that table, but its code changes in that one argument, so its next deploy is a new version. Commit the change and deploy main after it, so an older checkout does not deploy the ID back. A module folder gets the second Feature, for a copy of its own; to share the module instead, change that folder’s featureID to the Feature the module already lives in.

  2. sync stack add also chooses what the new stack reads, as ronja bind --stack <name> does in one folder. It fills in what the code writes ("write": true), or a workflow or Saved Agent it runs ("run": true), only when exactly one row of that name is in the new Feature itself, because a match anywhere else could be production’s: set each other one by hand in that stack’s bind map in ronja.json, to a row in the new Feature. It lists, folder by folder, every name it could not fill. A workflow’s own output ("output": true) needs nothing: its first run on the new stack makes it in the new Feature.

    A table one of the repository’s own workflows writes is not something to look up by name either: name it by that workflow’s folder, so each stack reads its own copy. An import already writes it that way. In the reading folder’s ronja.json, from is the workflow folder’s path and address is the name the workflow gives the table, and the folder needs "formatVersion": 7:

    "dependencies": {
    "weekly_revenue": {"kind": "table", "from": "../../workflows/compute-weekly-revenue", "address": "weekly_revenue"}
    }

    A table a pipeline folder builds is named the same way, with its .sql file as address.

  3. Run ronja sync apply --stack <name> --allow-create. Without --allow-create, sync apply only updates what already exists and refuses to create anything. When the new Feature already has a workflow, App, module or automation of the same name, the deploy stops with name_taken rather than create a second one beside it: the message names that row and the line to add to the folder’s ronja.lock.json so the stack deploys it instead. A folder that reads a workflow’s output is refused until that workflow has run once on the new stack: run it (ronja wf run --stack <name> in its folder), then apply again.

Take a change made in Ronja into the repository

Section titled “Take a change made in Ronja into the repository”

Anyone can still change something a repository deploys — in Ronja, by asking Ronja, or from a folder of their own — and it is marked Managed in git while they do. The repository’s next deploy stops on the change. To keep it:

  1. Run ronja <kind> pull in the folder: ronja wf pull, ronja app pull, ronja module pull, ronja pipeline pull or ronja automation pull.
  2. Read the diff it prints. The folder’s files now hold what is live.
  3. Commit the changed files.

The next ronja sync apply writes nothing for that folder. --dry-run shows the diff and changes nothing.

A pull reads only what is live, never a draft, and never replaces a change of your own that has not been deployed: it stops and names your files. Deploy your change first and combine the two by hand, or pass --force to replace your change with what is live. It also stops on changes you have not committed. Each refusal says why and what to do next.