Skip to content

Commit

Permalink
fix(deploy) docker compose v2 compatibilty (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
kon14 authored Sep 27, 2022
1 parent 6767589 commit 03e6995
Show file tree
Hide file tree
Showing 7 changed files with 620 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"@graphql-codegen/typescript-vue-urql": "^2.2.12",
"@openapitools/openapi-generator-cli": "^2.5.1",
"axios": "^0.24.0",
"docker-compose": "^0.23.17",
"dockerode": "^3.3.2",
"dotenv": "^16.0.1",
"fs-extra": "^10.0.0",
Expand All @@ -30,7 +29,8 @@
"natural-orderby": "^2.0.1",
"oclif": "^3.0.1",
"open": "^8.4.0",
"tslib": "^1"
"tslib": "^1",
"yaml": "^1.10.0"
},
"devDependencies": {
"@commitlint/cli": "^16.1.0",
Expand Down
8 changes: 7 additions & 1 deletion src/commands/deploy/rm.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Command, Flags, CliUx } from '@oclif/core';
import dockerCompose from 'docker-compose';
import dockerCompose from '../../docker/dockerCompose';
import { DeployStop } from './stop';
import { listLocalDeployments, getDeploymentPaths } from '../../deploy/utils';
import * as fs from 'fs';

Expand Down Expand Up @@ -32,6 +33,11 @@ export class DeployRemove extends Command {
// Retrieve Compose Files
const { manifestPath: cwd, deploymentPath } = getDeploymentPaths(this, target);
this.deploymentPath = deploymentPath;
// Stop Deployment
const runningDeployments = await listLocalDeployments(this, true);
if (runningDeployments.includes(target)) {
await DeployStop.run(['--target', target]);
}
// Run Docker Compose
await dockerCompose
.rm({
Expand Down
2 changes: 1 addition & 1 deletion src/commands/deploy/start.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Command, Flags, CliUx } from '@oclif/core';
import dockerCompose from 'docker-compose';
import dockerCompose from '../../docker/dockerCompose';
import { DeploymentConfiguration } from '../../deploy/types';
import { listLocalDeployments, getDeploymentPaths } from '../../deploy/utils';
import * as fs from 'fs-extra';
Expand Down
2 changes: 1 addition & 1 deletion src/commands/deploy/stop.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Command, Flags, CliUx } from '@oclif/core';
import dockerCompose from 'docker-compose';
import dockerCompose from '../../docker/dockerCompose';
import { listLocalDeployments, getDeploymentPaths } from '../../deploy/utils';

export class DeployStop extends Command {
Expand Down
Loading

0 comments on commit 03e6995

Please sign in to comment.