-
Notifications
You must be signed in to change notification settings - Fork 531
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
Add docker compose restart #316
Conversation
The build failed due to a timeout. Restarting build |
commands/docker-compose.ts
Outdated
@@ -100,3 +100,8 @@ export function composeUp(dockerComposeFileUri?: vscode.Uri, selectedComposeFile | |||
export function composeDown(dockerComposeFileUri?: vscode.Uri, selectedComposeFileUris?: vscode.Uri[]) { | |||
compose('down', 'to take down', dockerComposeFileUri, selectedComposeFileUris); | |||
} | |||
|
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.
Have you tried running this from the command palette? I think you'll find something undesirable happen.
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.
Yes. I don't know of any other way to run docker compose Up or Down (the package.json only specifies them in the commands section, not in any context menu).
The undesirable side-effect is that I'm asked to choose a compose file once for each of the compose down and up operations.
@fiveisprime, is that a critical point of friction?
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.
Wouldn't you be annoyed? It's just code, you can rewrite it to suit the necessary experience.
Also, I don't see any CTI tests... Please add them for compose up/down as well and anything related. |
commands/docker-compose.ts
Outdated
command: teleCmdId + command | ||
for (let command of commands) { | ||
selectedItems.forEach((item: Item) => { | ||
terminal.sendText(command.toLowerCase() === 'up' ? `docker-compose -f ${item.file} ${command} ${detached} ${build}` : `docker-compose -f ${item.file} ${command}`); |
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.
Could you move the ? : clauses onto separate lines for better readability? Thx.
commands/docker-compose.ts
Outdated
@@ -34,7 +34,7 @@ function computeItems(folder: vscode.WorkspaceFolder, uris: vscode.Uri[]): vscod | |||
return items; | |||
} | |||
|
|||
async function compose(command: string, message: string, dockerComposeFileUri?: vscode.Uri, selectedComposeFileUris?: vscode.Uri[]): Promise<void> { | |||
async function compose(commands: string[], message: string, dockerComposeFileUri?: vscode.Uri, selectedComposeFileUris?: vscode.Uri[]): Promise<void> { |
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.
commands: ('up' | 'down')[]
commands/docker-compose.ts
Outdated
reporter.sendTelemetryEvent('command', { | ||
command: teleCmdId + command | ||
for (let command of commands) { | ||
selectedItems.forEach((item: Item) => { |
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.
nit: I know, not your code, but... personally I don't like using forEach because you can't just debug through the loop with F10, you have to set a breakpoint in the function. for of is so much cleaner now.
Fixes #250.
Addresses #73.