mirror of
https://github.com/danbulant/docker-compose
synced 2026-05-21 21:38:58 +00:00
BLD: add support for logging for multiple services
This commit is contained in:
parent
b9cdd4132b
commit
a5d4e0fcbc
3 changed files with 5 additions and 5 deletions
2
index.d.ts
vendored
2
index.d.ts
vendored
|
|
@ -20,7 +20,7 @@ export declare function rm(options: IDockerComposeOptions): Promise<IDockerCompo
|
|||
|
||||
export declare function exec(container: String, command: String, options: IDockerComposeOptions): Promise<IDockerComposeResult>;
|
||||
|
||||
export declare function logs(container: String, options: IDockerComposeLogOptions): Promise<IDockerComposeResult>;
|
||||
export declare function logs(services: String[], options: IDockerComposeLogOptions): Promise<IDockerComposeResult>;
|
||||
|
||||
export declare function run(service: String, command: String, options: IDockerComposeOptions): Promise<IDockerComposeResult>;
|
||||
|
||||
|
|
|
|||
6
index.js
6
index.js
|
|
@ -386,7 +386,7 @@ const restartOne = function (service, options) {
|
|||
};
|
||||
|
||||
/**
|
||||
* @param {string} service
|
||||
* @param {?(string|string[])} services
|
||||
* @param {object} options
|
||||
* @param {string} options.cwd
|
||||
* @param {boolean} [options.log]
|
||||
|
|
@ -395,8 +395,8 @@ const restartOne = function (service, options) {
|
|||
* @param {?object} [options.env]
|
||||
* @param {?(string[]|Array<string|string[]>)} [options.composeOptions]
|
||||
*/
|
||||
const logs = function (service, options) {
|
||||
let args = [ service ];
|
||||
const logs = function (services, options) {
|
||||
let args = Array.isArray(services) ? services : [ services ];
|
||||
|
||||
if (options.follow) {
|
||||
args = [ '--follow', ...args ];
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ npm install --save-dev docker-compose
|
|||
* `stop(options)` - Stop running containers without removing them
|
||||
* `rm(options)` - Remove stopped service containers - always uses the `-f` flag due to non interactive mode
|
||||
* `exec(container, command, options)` - Exec `command` inside `container`, uses `-T` to properly handle stdin & stdout
|
||||
* `logs(container, command, options)` - Show logs of service. Use `options.follow` `true|false` to turn on `--follow` flag.
|
||||
* `logs(services, options)` - Show logs of service(s). Use `options.follow` `true|false` to turn on `--follow` flag.
|
||||
* `run(service, command, options)` - Run a one-off `command` on a service, uses `-T` to properly handle stdin & stdout
|
||||
* `buildAll(options)` - Build or rebuild services
|
||||
* `buildMany(services, options)` - Build or rebuild services
|
||||
|
|
|
|||
Loading…
Reference in a new issue