Skip to content

Commit

Permalink
Merge pull request #4138 from Microsoft/users/jikuma/DockerAndDockerC…
Browse files Browse the repository at this point in the history
…omposeLocalization

Docker and Docker Compose task localisation and required input fix
  • Loading branch information
jikuma authored Apr 26, 2017
2 parents 76272d5 + 4d77e9f commit 9d6740d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 18 deletions.
3 changes: 3 additions & 0 deletions Tasks/Docker/container.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
"use strict";

import path = require('path');
import * as tl from "vsts-task-lib/task";
import ContainerConnection from "./containerconnection";
import AuthenticationTokenProvider from "docker-common/registryauthenticationprovider/authenticationtokenprovider"
import ACRAuthenticationTokenProvider from "docker-common/registryauthenticationprovider/acrauthenticationtokenprovider"
import GenericAuthenticationTokenProvider from "docker-common/registryauthenticationprovider/genericauthenticationtokenprovider"
import Q = require('q');

tl.setResourcePath(path.join(__dirname, 'task.json'));

// Change to any specified working directory
tl.cd(tl.getInput("cwd"));

Expand Down
2 changes: 1 addition & 1 deletion Tasks/Docker/containerbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function findDockerFile(dockerfilepath : string) : string {

if (dockerfilepath.indexOf('*') >= 0 || dockerfilepath.indexOf('?') >= 0) {
tl.debug(tl.loc('ContainerPatternFound'));
var buildFolder = tl.getVariable('System.DefaultWorkingDirectory');
var buildFolder = tl.cwd();
var allFiles = tl.find(buildFolder);
var matchingResultsFiles = tl.match(allFiles, dockerfilepath, buildFolder, { matchBase: true });

Expand Down
6 changes: 2 additions & 4 deletions Tasks/Docker/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 2,
"Patch": 2
"Patch": 3
},
"demands": [],
"preview": "true",
Expand Down Expand Up @@ -49,16 +49,14 @@
"type": "connectedService:AzureRM",
"label": "Azure subscription",
"helpMarkDown": "Select an Azure subscription",
"visibleRule": "containerregistrytype = Azure Container Registry",
"required": true
"visibleRule": "containerregistrytype = Azure Container Registry"
},
{
"name": "azureContainerRegistry",
"label": "Azure Container Registry",
"type": "pickList",
"helpMarkDown": "Select an Azure Container Registry",
"visibleRule": "containerregistrytype = Azure Container Registry",
"required": true,
"defaultValue": ""
},
{
Expand Down
6 changes: 2 additions & 4 deletions Tasks/Docker/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 2,
"Patch": 2
"Patch": 3
},
"demands": [],
"preview": "true",
Expand Down Expand Up @@ -49,16 +49,14 @@
"type": "connectedService:AzureRM",
"label": "ms-resource:loc.input.label.azureSubscriptionEndpoint",
"helpMarkDown": "ms-resource:loc.input.help.azureSubscriptionEndpoint",
"visibleRule": "containerregistrytype = Azure Container Registry",
"required": true
"visibleRule": "containerregistrytype = Azure Container Registry"
},
{
"name": "azureContainerRegistry",
"label": "ms-resource:loc.input.label.azureContainerRegistry",
"type": "pickList",
"helpMarkDown": "ms-resource:loc.input.help.azureContainerRegistry",
"visibleRule": "containerregistrytype = Azure Container Registry",
"required": true,
"defaultValue": ""
},
{
Expand Down
2 changes: 2 additions & 0 deletions Tasks/DockerCompose/dockercompose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import GenericAuthenticationTokenProvider from "docker-common/registryauthentica

import Q = require('q');

tl.setResourcePath(path.join(__dirname, 'task.json'));

// Change to any specified working directory
tl.cd(tl.getInput("cwd"));

Expand Down
2 changes: 1 addition & 1 deletion Tasks/DockerCompose/dockercomposeutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as tl from "vsts-task-lib/task";
export function findDockerFile(dockerfilepath: string): string {
if (dockerfilepath.indexOf('*') >= 0 || dockerfilepath.indexOf('?') >= 0) {
tl.debug(tl.loc('ContainerPatternFound'));
var buildFolder = tl.getVariable('System.DefaultWorkingDirectory');
var buildFolder = tl.cwd();
var allFiles = tl.find(buildFolder);
var matchingResultsFiles = tl.match(allFiles, dockerfilepath, buildFolder, { matchBase: true });

Expand Down
6 changes: 2 additions & 4 deletions Tasks/DockerCompose/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 3,
"Patch": 6
"Patch": 7
},
"demands": [],
"preview": "true",
Expand Down Expand Up @@ -49,16 +49,14 @@
"type": "connectedService:AzureRM",
"label": "Azure subscription",
"helpMarkDown": "Select an Azure subscription",
"visibleRule": "containerregistrytype = Azure Container Registry",
"required": true
"visibleRule": "containerregistrytype = Azure Container Registry"
},
{
"name": "azureContainerRegistry",
"label": "Azure Container Registry",
"type": "pickList",
"helpMarkDown": "Select an Azure Container Registry",
"visibleRule": "containerregistrytype = Azure Container Registry",
"required": true,
"defaultValue": ""
},
{
Expand Down
6 changes: 2 additions & 4 deletions Tasks/DockerCompose/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 3,
"Patch": 6
"Patch": 7
},
"demands": [],
"preview": "true",
Expand Down Expand Up @@ -49,16 +49,14 @@
"type": "connectedService:AzureRM",
"label": "ms-resource:loc.input.label.azureSubscriptionEndpoint",
"helpMarkDown": "ms-resource:loc.input.help.azureSubscriptionEndpoint",
"visibleRule": "containerregistrytype = Azure Container Registry",
"required": true
"visibleRule": "containerregistrytype = Azure Container Registry"
},
{
"name": "azureContainerRegistry",
"label": "ms-resource:loc.input.label.azureContainerRegistry",
"type": "pickList",
"helpMarkDown": "ms-resource:loc.input.help.azureContainerRegistry",
"visibleRule": "containerregistrytype = Azure Container Registry",
"required": true,
"defaultValue": ""
},
{
Expand Down

0 comments on commit 9d6740d

Please sign in to comment.