app ⇒ App

The class to instantiate a new App

Kind: global variable
Returns: App - An App instance
Since: 3.0.0

Param Type Default Description
name String Name of the app
config Object Config for the app
[lando] Object {} A Lando instance

app.config

The apps configuration

Kind: static property of app
Since: 3.0.0

app.events

The apps event emitter

Kind: static property of app
Since: 3.0.0

app.info

Information about this app

Kind: static property of app
Since: 3.0.0

app.root

The apps root directory

Kind: static property of app
Since: 3.0.0

app.tasks

Tasks and commands the app can run

Kind: static property of app
Since: 3.0.0

app.destroy() ⇒ Promise

Hard removes all app services, volumes, networks, etc.

This differs from uninstall in that uninstall will only soft remove all app services, while maintaining things like volumes, networks, etc.

That said this DOES call both stop and uninstall under the hood.

Kind: static method of app
Returns: Promise - A Promise
Emits: pre_destroy, pre_stop, post_stop, pre_uninstall, post_uninstall, post_destroy
Since: 3.0.0

app.init() ⇒ Promise

Initializes the app

You will want to run this to get the app ready for lando.engine. This will load in relevant app plugins, build the docker compose files and get them ready to go

Kind: static method of app
Returns: Promise - A Promise.
Emits: pre_init, post_init, ready
Since: 3.0.0

app.rebuild() ⇒ Promise

Rebuilds an app.

This will stop an app, soft remove its services, rebuild those services and then, finally, start the app back up again. This is useful for developers who might want to tweak Dockerfiles or compose yamls.

Kind: static method of app
Returns: Promise - A Promise.
Emits: pre_stop, post_stop, pre_rebuild, pre_uninstall, post_uninstall, post_rebuild, pre_start, post_start
Since: 3.0.0

app.restart(app) ⇒ Promise

Stops and then starts an app.

This just runs app.stop and app.start in succession.

Kind: static method of app
Returns: Promise - A Promise.
Emits: pre_stop, post_stop, pre_start, post_start
Since: 3.0.0

Param Type Description
app Object A fully instantiated app object

app.start() ⇒ Promise

Starts an app.

This will start up all services/containers that have been defined for this app.

Kind: static method of app
Returns: Promise - A Promise.
Emits: pre_start, post_start
Since: 3.0.0

app.stop() ⇒ Promise

Stops an app.

This will stop all services/containers that have been defined for this app.

Kind: static method of app
Returns: Promise - A Promise.
Emits: pre_stop, post_stop
Since: 3.0.0

app.uninstall(purge) ⇒ Promise

Soft removes the apps services but maintains persistent data like app volumes.

This differs from destroy in that destroy will hard remove all app services, volumes, networks, etc as well as remove the app from the appRegistry.

Kind: static method of app
Returns: Promise - A Promise.
Emits: pre_uninstall, post_uninstall
Since: 3.0.0

Param Type Default Description
purge Boolean false A fully instantiated app object

"pre_destroy"

Event that runs before an app is destroyed.

Kind: event emitted
Since: 3.0.0

"post_destroy"

Event that runs after an app is destroyed.

Kind: event emitted
Since: 3.0.0

"pre_init"

Event that allows altering of the app object right before it is initialized.

Note that this is a global event so it is invoked with lando.events.on not app.events.on See example below:

Kind: event emitted
Since: 3.0.0
Properties

Name Type Description
app App The app instance.

"post_init"

Event that allows altering of the app object right after it has been full initialized and all its plugins have been loaded.

Kind: event emitted
Since: 3.0.0
Properties

Name Type Description
app App The app instance.

"ready"

Event that runs when the app is ready for action

Kind: event emitted
Since: 3.0.0
Properties

Name Type Description
app App The app instance.

"pre_rebuild"

Event that runs before an app is rebuilt.

Kind: event emitted

"post_rebuild"

Event that runs after an app is rebuilt.

Kind: event emitted
Since: 3.0.0

"pre_start"

Event that runs before an app starts up.

This is useful if you want to start up any support services before an app stars.

Kind: event emitted
Since: 3.0.0

"post_start"

Event that runs after an app is started.

This is useful if you want to perform additional operations after an app starts such as running additional build commands.

Kind: event emitted
Since: 3.0.0

"pre_stop"

Event that runs before an app stops.

Kind: event emitted
Since: 3.0.0

"post_stop"

Event that runs after an app stop.

Kind: event emitted
Since: 3.0.0

"pre_uninstall"

Event that runs before an app is uninstalled.

This is useful if you want to add or remove parts of the uninstall process. For example, it might be nice to persist a container whose data you do not want to replace in a rebuild and that cannot persist easily with a volume.

Kind: event emitted
Since: 3.0.0

"post_uninstall"

Event that runs after an app is uninstalled.

This is useful if you want to do some additional cleanup steps after an app is uninstalled such as invalidating any cached data.

Kind: event emitted
Since: 3.0.0