Skip to content

Commit

Permalink
added compose.create* commands
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-Symbroson committed Mar 13, 2024
1 parent ce2897b commit de6996d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions src/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,26 @@ export const buildOne = function (
return execCompose('build', [service], options)
}

export const createAll = function (
options: IDockerComposeOptions = {}
): Promise<IDockerComposeResult> {
return execCompose('create', [], options)
}

export const createMany = function (
services: string[],
options: IDockerComposeOptions = {}
): Promise<IDockerComposeResult> {
return execCompose('create', services, options)
}

export const createOne = function (
service: string,
options?: IDockerComposeOptions
): Promise<IDockerComposeResult> {
return execCompose('create', [service], options)
}

export const pullAll = function (
options: IDockerComposeOptions = {}
): Promise<IDockerComposeResult> {
Expand Down
4 changes: 2 additions & 2 deletions test/v2/compose.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ describe('when calling ps command', (): void => {

describe('when calling image list command', (): void => {
it('image list shows image data', async (): Promise<void> => {
await compose.buildAll({ cwd: path.join(__dirname), log: logOutput })
await compose.createAll({ cwd: path.join(__dirname), log: logOutput })

const std = await compose.image.list({
cwd: path.join(__dirname),
Expand Down Expand Up @@ -805,7 +805,7 @@ describe('when calling image list command', (): void => {
})

it('image list shows image data using json format', async (): Promise<void> => {
await compose.buildAll({ cwd: path.join(__dirname), log: logOutput })
await compose.createAll({ cwd: path.join(__dirname), log: logOutput })

const std = await compose.image.list({
cwd: path.join(__dirname),
Expand Down

0 comments on commit de6996d

Please sign in to comment.