Extends EventEmitter2
A Navy instance
Parameters
name
string The name of the current Navy.
Type: string
The normalised name of the current Navy (name without whitespaces).
Type: string
Returns the current State for this Navy.
Saves a new State for this Navy.
Parameters
state
State Returns Promise<void>
Registers a custom CLI command with the given name and callback function.
Any command registered can be run using navy run [name]
.
Parameters
Registers a middleware reducer function. See Writing Plugins.
Parameters
middlewareFn
Function Returns whether this Navy is initialised and ready to launch services.
Initialises this Navy with the given State.
Parameters
opts
State Returns Promise<void>
Deletes the state for this Navy. It won't be possible to interact with this Navy after calling this function unless you re-initialise it.
Returns Promise<void>
Launches the given services for this Navy.
Parameters
Returns Promise<void>
Relaunches (reconfigures) all of the services running in this Navy. This will pick up any changes to the compose configuration.
Parameters
opts
Object? Returns Promise<void>
Destroys all of the services in this Navy and deletes the state.
Returns Promise<void>
Returns a list of launched services for this Navy.
Returns Promise<ServiceList>
Starts the given services.
Parameters
Returns Promise<void>
Stops the given services.
Parameters
Returns Promise<void>
Restarts the given services.
Parameters
Returns Promise<void>
Forcefully stops the given services.
Parameters
Returns Promise<void>
Removes the given services. Requires the services to be stopped first.
Parameters
Returns Promise<void>
Makes sure the images for the given services are up to date, and restarts any running services with new images.
Parameters
Returns Promise<void>
Locks down the given service to the given docker image tag.
Parameters
Returns Promise<void>
Resets the version of the given service if useTag
was used.
Parameters
service
string Returns Promise<void>
Waits for the given services to be healthy. Resolves when all services are healthy.
Parameters
services
Array<string> progressCallback
Function retryConfig
RetryConfig (optional, default {factor:1.1,retries:30,minTimeout:200}
)Returns the external IP for accessing Docker and running services.
Returns the external port for the given service and internal private port.
Parameters
Returns the URL for the given service which can be used to access it if it exposes a HTTP server.
Parameters
service
string Returns an array of the names of the launched services for this Navy.
Returns Promise<Array<string>>
Returns an array of the names of all of the possible services for this Navy.
Returns Promise<Array<string>>
Returns a Navy
instance from the given Navy name.
Parameters
navyName
string? Returns Navy
Returns an array of Navy
instances which are currently imported and launched.
Returns an array of names of Navies which are currently imported and launched.
Returns Promise<Array<string>>
A "state" object of the current services, and other internal Navy state. This can be used to hang "state" off services which can then be used by middleware at runtime to modify the runtime configuration.
Accessing internal properties on state (properties other than "services") is not supported and backwards compatibility is not guaranteed.
Type: {driver: string?, configProvider: string?, path: string?, npmPackage: string?, services: Object?}
Properties