-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to compatible docker compose usage #195
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
75b8284
Update to compatible docker compose usage
rolljee 4d92ac1
Update src/commands/app/doctor.ts
rolljee b1e1387
Update src/commands/app/start-services.ts
rolljee 2b02665
Update src/commands/app/start-services.ts
rolljee a938f41
Update src/commands/app/start-services.ts
rolljee ef43257
Update src/commands/app/start-services.ts
rolljee 9764c04
Update src/commands/instance/spawn.ts
rolljee d46abb8
Update src/commands/instance/spawn.ts
rolljee 0b98938
Update src/commands/instance/spawn.ts
rolljee 1e34fd6
Update src/commands/app/start-services.ts
rolljee 5e08b58
Update src/commands/instance/spawn.ts
rolljee 436c170
Update src/commands/instance/spawn.ts
rolljee 72abcc4
Refactoring checkPrerequisite
rolljee 91da5ef
Update src/commands/app/doctor.ts
rolljee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Listr from "listr"; | ||
|
||
import { execute } from "../execute"; | ||
import { Kommand } from "../../common"; | ||
|
||
|
||
const MIN_DOCO_VERSION = "2.0.0"; | ||
|
||
export async function checkPrerequisites(ctx: Kommand): Promise<boolean> { | ||
const checks: Listr = new Listr([ | ||
{ | ||
title: `docker compose exists and the version is at least ${MIN_DOCO_VERSION}`, | ||
task: async () => { | ||
const docov = await execute("docker", "compose", "version"); | ||
const matches = docov.stdout.match(/[^0-9.]*([0-9.]*).*/); | ||
const docoVersion = matches ? matches[1] : null; | ||
ctx.logInfo(`Found Docker Compose version: ${docoVersion}`); | ||
|
||
if (!docoVersion) { | ||
throw new Error( | ||
"Unable to read the version of Docker Compose. Are you sure Docker and the Compose plugin are installed?" | ||
); | ||
} | ||
|
||
|
||
if (docoVersion < MIN_DOCO_VERSION) { | ||
throw new Error( | ||
`Your version of Docker Compose (${docoVersion}) is below the required version (${MIN_DOCO_VERSION}).` | ||
); | ||
} | ||
}, | ||
}, | ||
]); | ||
|
||
try { | ||
await checks.run(); | ||
|
||
return true; | ||
} catch (error: any) { | ||
ctx.logKo(error.message); | ||
|
||
return false; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.