From b54747b086f1de491e7baf269ad70eb68f0c45f0 Mon Sep 17 00:00:00 2001 From: Krishna Aditya Date: Fri, 18 Mar 2016 07:23:45 +0530 Subject: [PATCH] adding cwd input to all actions --- src/tasks/dockerRun/dockerAnyCmd.ts | 3 +++ src/tasks/dockerRun/dockerBuild.ts | 3 +++ src/tasks/dockerRun/dockerPublish.ts | 3 +++ src/tasks/dockerRun/dockerRun.ts | 3 +++ src/tasks/dockerRun/task.json | 8 ++++++++ 5 files changed, 20 insertions(+) diff --git a/src/tasks/dockerRun/dockerAnyCmd.ts b/src/tasks/dockerRun/dockerAnyCmd.ts index d0640b1..226471a 100644 --- a/src/tasks/dockerRun/dockerAnyCmd.ts +++ b/src/tasks/dockerRun/dockerAnyCmd.ts @@ -4,6 +4,9 @@ import tl = require("vsts-task-lib/task"); import * as docker from "./dockerCommand"; export function runCommand(): void { + var cwd = tl.getInput("cwd"); + tl.cd(cwd); + var dockerConnectionString = tl.getInput("dockerServiceEndpoint", true); var registryEndpoint = tl.getInput("dockerRegistryServiceEndpoint", true); var commandLine = tl.getInput("customCommand", true); diff --git a/src/tasks/dockerRun/dockerBuild.ts b/src/tasks/dockerRun/dockerBuild.ts index ee31204..ad3204e 100644 --- a/src/tasks/dockerRun/dockerBuild.ts +++ b/src/tasks/dockerRun/dockerBuild.ts @@ -6,6 +6,9 @@ import tl = require("vsts-task-lib/task"); import * as docker from "./dockerCommand"; export function dockerBuild(): void { + var cwd = tl.getInput("cwd"); + tl.cd(cwd); + var dockerConnectionString = tl.getInput("dockerServiceEndpoint", true); var registryEndpoint = tl.getInput("dockerRegistryServiceEndpoint", true); var dockerFilePattern = tl.getInput("dockerFile", true); diff --git a/src/tasks/dockerRun/dockerPublish.ts b/src/tasks/dockerRun/dockerPublish.ts index 6718066..3379ce5 100644 --- a/src/tasks/dockerRun/dockerPublish.ts +++ b/src/tasks/dockerRun/dockerPublish.ts @@ -4,6 +4,9 @@ import tl = require("vsts-task-lib/task"); import * as docker from "./dockerCommand"; export function dockerPublish(): void { + var cwd = tl.getInput("cwd"); + tl.cd(cwd); + var dockerConnectionString = tl.getInput("dockerServiceEndpoint", true); var registryEndpoint = tl.getInput("dockerRegistryServiceEndpoint", true); var imageName = tl.getInput("imageName", true); diff --git a/src/tasks/dockerRun/dockerRun.ts b/src/tasks/dockerRun/dockerRun.ts index e4bb7ca..3912ebc 100644 --- a/src/tasks/dockerRun/dockerRun.ts +++ b/src/tasks/dockerRun/dockerRun.ts @@ -4,6 +4,9 @@ import tl = require("vsts-task-lib/task"); import * as docker from "./dockerCommand"; export function dockerRun(): void { + var cwd = tl.getInput("cwd"); + tl.cd(cwd); + var dockerConnectionString = tl.getInput("dockerServiceEndpoint", true); var registryEndpoint = tl.getInput("dockerRegistryServiceEndpoint", true); var imageName = tl.getInput("imageName", true); diff --git a/src/tasks/dockerRun/task.json b/src/tasks/dockerRun/task.json index b03d5a5..3f48652 100644 --- a/src/tasks/dockerRun/task.json +++ b/src/tasks/dockerRun/task.json @@ -31,6 +31,14 @@ "required": true, "helpMarkDown": "The Docker Hub endpoint, to login to Docker Hub." }, + { + "name": "cwd", + "type": "filePath", + "label": "Working Directory", + "defaultValue": "$(System.DefaultWorkingDirectory)", + "required": false, + "helpMarkDown": "Current working directory where the certs folder will be created." + }, { "name": "action", "type": "pickList",