BettikDocsSign in

Reference · the tools · templates

save_environment

What it does

Save a running environment, in one step: the environment is stopped for a few seconds, its directory is kept -- compose.yaml, the scripts, projects/ with dependencies and git history, and its data as it is -- as the template's next saved environment (name@s3), and the environment starts again. .env is never kept: it holds the values of the env vars you set on the box (tokens, connection strings), and wherever the saved environment is installed, .env is written again from that box's own env vars. The passwords Bettik made for the environment (bettik.json "secrets") do go along, because its data was made with them. A value a script or the app copied into any other file goes along with that file. A saved environment is for keeping, for moving to another box, and for handing to someone in the same account. It holds the environment's private data and history, so only members of its account see it, and it is never shared by link. Tell the user so, both before and after. To share it, or to have a copy without the private data, publish a version of its template: publish_template. Every template has a kind. Choose it with the user by one question -- what does someone do with it first? Use it: app. Play it: game. Build on it: kit. Read it, watch it, or load it as data: content. Only when none of the four fits, and the user agrees, use other, with kind_reason saying why. Without go: true this only says what would happen: tell the user, including the kind and that the private data goes with it, and save it once they say yes. Where it goes: with "org/name", that family's or organization's template (any you belong to, from any box); with no name, the template the environment was installed from; otherwise the account that owns this box, under the name given or the environment's own. (formerly snapshot_bundle)

What it needs to know

environment_id
The running environment to save, as environment_status shows it.
kind
What the template is: app (people use it), game (people play it), kit (people build on it), content (people read it, watch it, or load it as data). other only with kind_reason. One of app, game, kit, content, other.
kind_reason · optional
Required with kind other: why none of app, game, kit or content fits.
name · optional
What to call the template: "worbblepop", or "org/name". Omit for the template it was installed from.
description · optional
One line saying what it is, in the author's words.
note · optional
One line to find this saved environment by later: "before trying the new voice picker".
go · optional
Actually save it. Without it, only say what would happen.
confirm · optional
Save although the name already has newer or unrelated saved environments -- only after asking.
keep_stopped · optional
Leave the environment stopped afterwards, e.g. to destroy it once its template is made.
box · optional
Which box: its name and account, "home.frank" or "jordan.northwind", or just "home" when only one of your boxes is called that. Omit it for your current box (switch_box changes it; list_boxes says which it is).
session_box · optional
The box this session runs on, if it runs on one of yours: its name, as the on-box instructions give it ("frankh90.hemlane"). With it, a call that names no box is checked against your current box.

Where it lands

On one of your boxes: the one named in box, or your default box when none is named.