app ⇒ App

The class to instantiate a new App

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

Returns: App - An App instance

app.config

The apps configuration

Since: 3.0.0

app.events

The apps event emitter

Since: 3.0.0

app.info

Information about this app

Since: 3.0.0

app.root

The apps root directory

Since: 3.0.0

app.tasks

Tasks and commands the app can run

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.

Emits: pre_destroy, pre_stop, post_stop, pre_uninstall, post_uninstall, post_destroy
Since: 3.0.0
Returns: Promise - A Promise

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

Emits: pre_init, post_init, ready
Since: 3.0.0
Returns: Promise - A Promise.

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.

Emits: pre_stop, post_stop, pre_rebuild, pre_uninstall, post_uninstall, post_rebuild, pre_start, post_start
Since: 3.0.0
Returns: Promise - A Promise.

app.restart(app) ⇒ Promise

Stops and then starts an app.

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

Emits: pre_stop, post_stop, pre_start, post_start
Since: 3.0.0

Param Type Description
app Object A fully instantiated app object

Returns: Promise - A Promise.

app.start() ⇒ Promise

Starts an app.

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

Emits: pre_start, post_start
Since: 3.0.0
Returns: Promise - A Promise.

app.stop() ⇒ Promise

Stops an app.

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

Emits: pre_stop, post_stop
Since: 3.0.0
Returns: Promise - A Promise.

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.

Emits: pre_uninstall, post_uninstall
Since: 3.0.0

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

Returns: Promise - A Promise.

"pre_destroy"

Event that runs before an app is destroyed.

Since: 3.0.0

"post_destroy"

Event that runs after an app is destroyed.

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:

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.

Since: 3.0.0
Properties

Name Type Description
app App The app instance.

"ready"

Event that runs when the app is ready for action

Since: 3.0.0
Properties

Name Type Description
app App The app instance.

"pre_rebuild"

Event that runs before an app is rebuilt.

"post_rebuild"

Event that runs after an app is rebuilt.

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.

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.

Since: 3.0.0

"pre_stop"

Event that runs before an app stops.

Since: 3.0.0

"post_stop"

Event that runs after an app stop.

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.

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.

Since: 3.0.0

results matching ""

    No results matching ""