Skip to content

Commit

Permalink
sync with master
Browse files Browse the repository at this point in the history
  • Loading branch information
rosanch committed Dec 6, 2018
2 parents c607b70 + d4c1b3e commit a6ce8d2
Show file tree
Hide file tree
Showing 35 changed files with 250 additions and 362 deletions.
5 changes: 5 additions & 0 deletions .azure-pipelines/common/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
steps:
- task: NodeTool@0
displayName: 'Use Node 8.x'
inputs:
versionSpec: 8.x

- task: Npm@1
displayName: 'npm install'

Expand Down
7 changes: 0 additions & 7 deletions .azure-pipelines/common/publish-test-results.yml

This file was deleted.

22 changes: 19 additions & 3 deletions .azure-pipelines/common/test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
steps:
- task: Gulp@0
- script: |
sudo cp .azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
sudo chmod +x /etc/init.d/xvfb
sudo update-rc.d xvfb defaults
sudo service xvfb start
displayName: 'Start X Virtual Frame Buffer'
condition: eq(variables['Agent.OS'], 'Linux')

- task: Npm@1
displayName: 'Test'
inputs:
targets: 'test'
command: custom
customCommand: test
env:
SERVICE_PRINCIPAL_CLIENT_ID: $(SERVICE_PRINCIPAL_CLIENT_ID)
SERVICE_PRINCIPAL_SECRET: $(SERVICE_PRINCIPAL_SECRET)
SERVICE_PRINCIPAL_DOMAIN: $(SERVICE_PRINCIPAL_DOMAIN)
DISPLAY: :10 # Only necessary for linux tests
DOCKER_UNAVAILABLE: ${{ parameters.dockerUnavailable }}

- template: publish-test-results.yml
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '*-results.xml'
testRunTitle: '$(Agent.OS)'
condition: succeededOrFailed()
18 changes: 0 additions & 18 deletions .azure-pipelines/linux/test-linux.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .azure-pipelines/macOs/test.yml

This file was deleted.

8 changes: 5 additions & 3 deletions .azure-pipelines/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ jobs:
- template: common/webpack-prod.yml # This will also run during vsce package, but vscep pack doesn't show STDOUT so we won't see full errors there
- template: common/publish-vsix.yml # Only publish vsix from linux build since we use this to release and want to stay consistent
- template: common/lint.yml
- template: linux/test-linux.yml
- template: common/test.yml

- job: macOS
pool:
vmImage: macOS 10.13
steps:
- template: common/build.yml
# - template: common/webpack-prod.yml
- template: common/webpack-prod.yml
- template: common/lint.yml
# - template: macOs/test.yml
- template: common/test.yml
parameters:
dockerUnavailable: 1 # Docker not available on MacOS agents (https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/docker)
4 changes: 3 additions & 1 deletion commands/azureCommands/acr-logs-utils/logFileManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export async function downloadLog(content: string, title: string): Promise<void>
filters: { 'Log': ['.log', '.txt'] },
defaultUri: vscode.Uri.file(`${title}.log`)
});
fse.writeFile(uri.fsPath, content,
fse.writeFile(
uri.fsPath,
content,
(err) => {
if (err) { throw err; }
});
Expand Down
12 changes: 0 additions & 12 deletions commands/docker-compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import * as path from 'path';
import * as vscode from 'vscode';
import { COMPOSE_FILE_GLOB_PATTERN } from '../constants';
import { ext } from '../extensionVariables';
import { reporter } from '../telemetry/telemetry';
import { quickPickWorkspaceFolder } from './utils/quickPickWorkspaceFolder';
const teleCmdId: string = 'vscode-docker.compose.'; // we append up or down when reporting telemetry

async function getDockerComposeFileUris(folder: vscode.WorkspaceFolder): Promise<vscode.Uri[]> {
return await vscode.workspace.findFiles(new vscode.RelativePattern(folder, COMPOSE_FILE_GLOB_PATTERN), null, 9999, undefined);
Expand Down Expand Up @@ -75,16 +73,6 @@ async function compose(commands: ('up' | 'down')[], message: string, dockerCompo
terminal.sendText(command.toLowerCase() === 'up' ? `docker-compose -f "${item.file}" ${command} ${detached} ${build}` : `docker-compose -f "${item.file}" ${command}`);
});
terminal.show();
if (reporter) {
/* __GDPR__
"command" : {
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
reporter.sendTelemetryEvent('command', {
command: teleCmdId + command
});
}
}

}
Expand Down
10 changes: 0 additions & 10 deletions commands/inspect-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { IActionContext } from "vscode-azureextensionui";
import DockerInspectDocumentContentProvider from "../documentContentProviders/dockerInspect";
import { ImageNode } from "../explorer/models/imageNode";
import { reporter } from "../telemetry/telemetry";
import { quickPickImage } from "./utils/quick-pick-image";

export default async function inspectImage(actionContext: IActionContext, context: ImageNode | undefined): Promise<void> {
Expand All @@ -24,14 +23,5 @@ export default async function inspectImage(actionContext: IActionContext, contex

if (imageToInspect) {
await DockerInspectDocumentContentProvider.openImageInspectDocument(imageToInspect);

if (reporter) {
/* __GDPR__
"command" : {
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
reporter.sendTelemetryEvent("command", { command: "vscode-docker.image.inspect" });
}
}
}
25 changes: 0 additions & 25 deletions commands/push-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ import { configurationKeys } from '../constants';
import { ImageNode } from '../explorer/models/imageNode';
import { RootNode } from '../explorer/models/rootNode';
import { ext } from '../extensionVariables';
import { reporter } from '../telemetry/telemetry';
import { askToSaveRegistryPath } from './registrySettings';
import { addImageTaggingTelemetry, getOrAskForImageAndTag, IHasImageDescriptorAndLabel, tagImage } from './tag-image';
const teleCmdId: string = 'vscode-docker.image.push';
const teleAzureId: string = 'vscode-docker.image.push.azureContainerRegistry';

export async function pushImage(actionContext: IActionContext, context: ImageNode | RootNode | undefined): Promise<void> {
let properties: {
Expand Down Expand Up @@ -53,27 +50,5 @@ export async function pushImage(actionContext: IActionContext, context: ImageNod
const terminal = ext.terminalProvider.createTerminal(imageName);
terminal.sendText(`docker push ${imageName}`);
terminal.show();
if (reporter) {
/* __GDPR__
"command" : {
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
reporter.sendTelemetryEvent('command', {
command: teleCmdId
});

if (imageName.toLowerCase().includes('azurecr.io')) {
/* __GDPR__
"command" : {
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
reporter.sendTelemetryEvent('command', {
command: teleAzureId
});

}
}
}
}
11 changes: 0 additions & 11 deletions commands/remove-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { IActionContext } from 'vscode-azureextensionui';
import { dockerExplorerProvider } from '../dockerExtension';
import { ContainerNode } from '../explorer/models/containerNode';
import { RootNode } from '../explorer/models/rootNode';
import { reporter } from '../telemetry/telemetry';
import { docker } from './utils/docker-endpoint';
import { ContainerItem, quickPickContainer } from './utils/quick-pick-container';

Expand Down Expand Up @@ -60,14 +59,4 @@ export async function removeContainer(actionContext: IActionContext, context: Ro
});
}));
}

if (reporter) {
/* __GDPR__
"command" : {
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
reporter.sendTelemetryEvent("command", { command: teleCmdId });
}

}
15 changes: 0 additions & 15 deletions commands/remove-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@

import vscode = require('vscode');
import { IActionContext } from 'vscode-azureextensionui';
import { dockerExplorerProvider } from '../dockerExtension';
import { ImageNode } from "../explorer/models/imageNode";
import { RootNode } from '../explorer/models/rootNode';
import { reporter } from '../telemetry/telemetry';
import { docker } from './utils/docker-endpoint';
import { ImageItem, quickPickImage } from './utils/quick-pick-image';

const teleCmdId: string = 'vscode-docker.image.remove';

export async function removeImage(actionContext: IActionContext, context: ImageNode | RootNode | undefined): Promise<void> {

let imagesToRemove: Docker.ImageDesc[];
Expand Down Expand Up @@ -52,15 +48,4 @@ export async function removeImage(actionContext: IActionContext, context: ImageN
});
}));
}

if (reporter) {
/* __GDPR__
"command" : {
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
reporter.sendTelemetryEvent('command', {
command: teleCmdId
});
}
}
21 changes: 3 additions & 18 deletions commands/restart-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@
* Licensed under the MIT License. See LICENSE.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import vscode = require('vscode');
import { IActionContext } from 'vscode-azureextensionui';
import { dockerExplorerProvider } from '../dockerExtension';
import { ContainerNode } from '../explorer/models/containerNode';
import { reporter } from '../telemetry/telemetry';
import { RootNode } from '../explorer/models/rootNode';
import { docker } from './utils/docker-endpoint';
import { ContainerItem, quickPickContainer } from './utils/quick-pick-container';

import vscode = require('vscode');
import { IActionContext } from 'vscode-azureextensionui';
import { RootNode } from '../explorer/models/rootNode';

const teleCmdId: string = 'vscode-docker.container.restart';

export async function restartContainer(actionContext: IActionContext, context: RootNode | ContainerNode | undefined): Promise<void> {

let containersToRestart: Docker.ContainerDesc[];
Expand Down Expand Up @@ -59,16 +55,5 @@ export async function restartContainer(actionContext: IActionContext, context: R
});
});
}));

if (reporter) {
/* __GDPR__
"command" : {
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
reporter.sendTelemetryEvent('command', {
command: teleCmdId
});
}
}
}
12 changes: 0 additions & 12 deletions commands/showlogs-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { IActionContext } from 'vscode-azureextensionui';
import { ContainerNode } from '../explorer/models/containerNode';
import { RootNode } from '../explorer/models/rootNode';
import { ext } from '../extensionVariables';
import { reporter } from '../telemetry/telemetry';
import { ContainerItem, quickPickContainer } from './utils/quick-pick-container';
const teleCmdId: string = 'vscode-docker.container.show-logs';

export async function showLogsContainer(actionContext: IActionContext, context: RootNode | ContainerNode | undefined): Promise<void> {

Expand All @@ -34,15 +32,5 @@ export async function showLogsContainer(actionContext: IActionContext, context:
const terminal = ext.terminalProvider.createTerminal(containerToLog.Image);
terminal.sendText(`docker logs -f ${containerToLog.Id}`);
terminal.show();
if (reporter) {
/* __GDPR__
"command" : {
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
reporter.sendTelemetryEvent('command', {
command: teleCmdId
});
}
}
}
3 changes: 2 additions & 1 deletion commands/start-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export async function startAzureCLI(actionContext: IActionContext): Promise<cp.C
actionContext.properties.engineType = DockerEngineType[engineType];

if (engineType === DockerEngineType.Windows) {
const selected = await vscode.window.showErrorMessage<vscode.MessageItem>('Currently, you can only run the Azure CLI when running Linux based containers.',
const selected = await vscode.window.showErrorMessage<vscode.MessageItem>(
'Currently, you can only run the Azure CLI when running Linux based containers.',
{
title: 'More Information',
},
Expand Down
14 changes: 0 additions & 14 deletions commands/stop-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@

import { dockerExplorerProvider } from '../dockerExtension';
import { ContainerNode } from '../explorer/models/containerNode';
import { reporter } from '../telemetry/telemetry';
import { docker } from './utils/docker-endpoint';
import { ContainerItem, quickPickContainer } from './utils/quick-pick-container';

import vscode = require('vscode');
import { IActionContext } from 'vscode-azureextensionui';
import { RootNode } from '../explorer/models/rootNode';

const teleCmdId: string = 'vscode-docker.container.stop';

export async function stopContainer(actionContext: IActionContext, context: RootNode | ContainerNode | undefined): Promise<void> {
let containersToStop: Docker.ContainerDesc[];

Expand Down Expand Up @@ -58,16 +55,5 @@ export async function stopContainer(actionContext: IActionContext, context: Root
});
});
}));

if (reporter) {
/* __GDPR__
"command" : {
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
reporter.sendTelemetryEvent('command', {
command: teleCmdId
});
}
}
}
3 changes: 2 additions & 1 deletion commands/system-prune.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export async function systemPrune(actionContext: IActionContext): Promise<void>

try {
if (configOptions.get('promptOnSystemPrune', true)) {
let res = await vscode.window.showWarningMessage<vscode.MessageItem>('Remove all unused containers, volumes, networks and images (both dangling and unreferenced)?',
let res = await vscode.window.showWarningMessage<vscode.MessageItem>(
'Remove all unused containers, volumes, networks and images (both dangling and unreferenced)?',
{ title: 'Yes' },
{ title: 'Cancel', isCloseAffordance: true }
);
Expand Down
Loading

0 comments on commit a6ce8d2

Please sign in to comment.