From 80c93282d5391d6af3f3b49a1c9418dba389e59f Mon Sep 17 00:00:00 2001 From: Brian Dukes Date: Fri, 22 Oct 2021 10:40:26 -0500 Subject: [PATCH] Use dedicated deploy folder Fixes #42 --- cantarus-polydeploy-client/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cantarus-polydeploy-client/index.js b/cantarus-polydeploy-client/index.js index 74f08e0..36c590e 100644 --- a/cantarus-polydeploy-client/index.js +++ b/cantarus-polydeploy-client/index.js @@ -1,3 +1,4 @@ +const path = require("path"); const taskLib = require("azure-pipelines-task-lib/task"); const deployPath = taskLib.getPathInput("deploy-path", true, true); @@ -8,11 +9,17 @@ const installationStatusTimeout = taskLib.getInput( "installation-status-timeout" ); +const deployDirName = `deploy-${Date.now()}`; +const deployDirPath = path.join(taskLib.cwd(), deployDirName); +taskLib.mkdirP(deployDirPath); + taskLib.findMatch(deployPath, "**/*.zip").forEach((zipPath) => { - taskLib.debug(`Copying ${zipPath} to ${taskLib.cwd()}`); - taskLib.cp(zipPath, taskLib.cwd()); + taskLib.debug(`Copying ${zipPath} to ${deployDirPath}`); + taskLib.cp(zipPath, deployDirPath); }); +taskLib.cd(deployDirPath); + let toolRunner = taskLib .tool("DeployClient.exe") .arg("--target-uri")