From 6360e6a20b967c3532bb9c3c604f1dfe927da0e3 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Mon, 7 May 2018 09:57:15 +0200 Subject: [PATCH] fix(api): use the folder of the stackfile as working dir when deploying a stack (#1869) --- api/exec/stack_manager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/exec/stack_manager.go b/api/exec/stack_manager.go index 232ad68b5..d8da84df1 100644 --- a/api/exec/stack_manager.go +++ b/api/exec/stack_manager.go @@ -81,7 +81,8 @@ func (manager *StackManager) Deploy(stack *portainer.Stack, prune bool, endpoint env = append(env, envvar.Name+"="+envvar.Value) } - return runCommandAndCaptureStdErr(command, args, env, stack.ProjectPath) + stackFolder := path.Dir(stackFilePath) + return runCommandAndCaptureStdErr(command, args, env, stackFolder) } // Remove executes the docker stack rm command.