Sandboxes

Contents

Sandboxes

Sandboxes

Developers may use the CLI to run different instances of XP locally. These instances are called sandboxes. Each sandbox will be associated with a specific distribution (version) of Enonic XP and will have its own Enonic XP home folder.

The CLI automates setting up, starting, stopping and upgrading sandboxes. Sandbox commands list is available by running following command:

$ enonic sandbox

Manage XP development instances

USAGE:
   Enonic CLI sandbox command [command options] [arguments...]

COMMANDS:
     list, ls         List all sandboxes
     start            Start the sandbox.
     stop             Stop the sandbox started in detached mode.
     create           Create a new sandbox.
     delete, del, rm  Delete a sandbox
     upgrade, up      Upgrades the distribution version.

OPTIONS:
   --help, -h  show help

Create

Starts a new sandbox wizard asking for a name and an enonic distribution version:

$ enonic sandbox create [name] [-v <value>] [-a]

Options:

Option Description

name

sandbox name

-v, --version

Use specific distro version

-a, --all

List all distro versions

If all params are present and correct, sandbox is created immediately without wizard allowing usage in script files.
Example creating a 'myBox' sandbox using Enonic XP version 7.2.1
$ enonic sandbox create myBox -v 7.2.1

List

Lists all sandboxes previously created by user:

$ enonic sandbox list
Example output:
$ enonic sandbox ls

* Sandbox1 ( windows-sdk-7.2.1 )
  Sandbox2 ( windows-sdk-7.2.0 )
  Sandbox3 ( windows-sdk-7.0.3 )
  Sandbox4 ( windows-sdk-7.2.1 )
Asterisk marks currently running sandbox

Start

Starts a sandbox and ensures that only one is started at a time:

$ enonic sandbox start [name] [-d]

Options:

Option Description

name

sandbox name

--dev

Run enonic XP distribution in development mode

-d, --detach

flag to start sandbox in detached mode (background process)

Example starting 'myBox' sandbox in a dev mode:
$ enonic sandbox start myBox --dev

Stop

Stops a running sandbox:

$ enonic sandbox stop
only sandboxes started with CLI can be stopped using this command.
Example stopping sandbox:
$ enonic sandbox stop

Upgrade

Upgrades enonic distribution used for a sandbox:

$ enonic sandbox upgrade [name] [-v <value>]

Options:

Option Description

name

sandbox name

-v, --version

enonic distribution version

Downgrades are not permitted.
Example upgrading enonic distribution for 'myBox' sandbox to 'windows-sdk-7.2.1':
$ enonic sandbox upgrade myBox -v 7.2.1

Delete

Deletes a sandbox:

$ enonic sandbox delete [name] [-f]

Options:

Option Description

name

sandbox name

-f, --force

assume “Yes” as answer to all prompts and run non-interactively

All data that may have been created in this sandbox will be deleted.
Example deleting 'myBox' sandbox:
$ enonic sandbox delete myBox -f

Contents