Skip to content
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

Recognize "compose.yaml" as a compose file #2656

Merged
merged 1 commit into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 8 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,37 +181,22 @@
"group": "docker"
},
{
"when": "resourceFilename =~ /^(?:(?!^docker-compose\\.ya?ml$).)*\\.ya?ml$/i && isAzureAccountInstalled",
"when": "resourceFilename =~ /^(?:(?!compose.*\\.ya?ml$).)*\\.ya?ml$/i && isAzureAccountInstalled",
"command": "vscode-docker.registries.azure.runFileAsTask",
"group": "docker"
},
{
"when": "resourceFilename == docker-compose.yml",
"when": "resourceFilename =~ /compose.*\\.ya?ml$/i",
"command": "vscode-docker.compose.down",
"group": "docker"
},
{
"when": "resourceFilename == docker-compose.yml",
"when": "resourceFilename =~ /compose.*\\.ya?ml$/i",
"command": "vscode-docker.compose.restart",
"group": "docker"
},
{
"when": "resourceFilename == docker-compose.yml",
"command": "vscode-docker.compose.up",
"group": "docker"
},
{
"when": "resourceFilename == docker-compose.debug.yml",
"command": "vscode-docker.compose.down",
"group": "docker"
},
{
"when": "resourceFilename == docker-compose.debug.yml",
"command": "vscode-docker.compose.restart",
"group": "docker"
},
{
"when": "resourceFilename == docker-compose.debug.yml",
"when": "resourceFilename =~ /compose.*\\.ya?ml$/i",
"command": "vscode-docker.compose.up",
"group": "docker"
},
Expand All @@ -228,22 +213,22 @@
"group": "docker"
},
{
"when": "resourceFilename =~ /^(?:(?!^docker-compose\\.ya?ml$).)*\\.ya?ml$/i && isAzureAccountInstalled",
"when": "resourceFilename =~ /^(?:(?!compose.*\\.ya?ml$).)*\\.ya?ml$/i && isAzureAccountInstalled",
"command": "vscode-docker.registries.azure.runFileAsTask",
"group": "docker"
},
{
"when": "resourceFilename =~ /docker-compose/i",
"when": "resourceFilename =~ /compose.*\\.ya?ml$/i",
"command": "vscode-docker.compose.down",
"group": "docker"
},
{
"when": "resourceFilename =~ /docker-compose/i",
"when": "resourceFilename =~ /compose.*\\.ya?ml$/i",
"command": "vscode-docker.compose.restart",
"group": "docker"
},
{
"when": "resourceFilename =~ /docker-compose/i",
"when": "resourceFilename =~ /compose.*\\.ya?ml$/i",
"command": "vscode-docker.compose.up",
"group": "docker"
},
Expand Down
1 change: 1 addition & 0 deletions resources/templates/.dockerignore.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
{{/unless}}
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const imageTagRegExp = new RegExp('^[a-zA-Z0-9.-_/]{1,256}:(?![.-])[a-zA-

// GLOB Patterns
export const FROM_DIRECTIVE_PATTERN = /^\s*FROM\s*([\w-\/:]*)(\s*AS\s*[a-z][a-z0-9-_\\.]*)?$/i;
export const COMPOSE_FILE_GLOB_PATTERN = '**/[dD][oO][cC][kK][eE][rR]-[cC][oO][mM][pP][oO][sS][eE]*.{[yY][aA][mM][lL],[yY][mM][lL]}';
export const COMPOSE_FILE_GLOB_PATTERN = '**/*[cC][oO][mM][pP][oO][sS][eE]*.{[yY][aA][mM][lL],[yY][mM][lL]}';
export const DOCKERFILE_GLOB_PATTERN = '**/{*.[dD][oO][cC][kK][eE][rR][fF][iI][lL][eE],[dD][oO][cC][kK][eE][rR][fF][iI][lL][eE]}';
export const YAML_GLOB_PATTERN = '**/*.{[yY][aA][mM][lL],[yY][mM][lL]}';
export const CSPROJ_GLOB_PATTERN = '**/*.{[cC][sS][pP][rR][oO][jJ]}';
Expand Down
2 changes: 1 addition & 1 deletion src/telemetry/registerListeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function registerListeners(): void {

registerEvent('composefilesave', workspace.onDidSaveTextDocument, async (context: IActionContext, doc: TextDocument) => {
// If it's not a compose file, skip
if (!/compose.*\.ya?ml/i.test(doc.fileName)) {
if (!/compose.*\.ya?ml$/i.test(doc.fileName)) {
context.telemetry.suppressAll = true;
return;
}
Expand Down