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

Docker and Docker Compose task localisation and required input fix #4136

Merged
merged 1 commit into from
Apr 26, 2017
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
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