diff --git a/api/tasks/runner.go b/api/tasks/runner.go index 124270fd..c823c6e6 100644 --- a/api/tasks/runner.go +++ b/api/tasks/runner.go @@ -227,7 +227,7 @@ func (t *task) updateRepository() error { cmd.Dir = util.Config.TmpPath gitSshCommand := "ssh -o StrictHostKeyChecking=no -i " + t.repository.SshKey.GetPath() - cmd.Env = t.envVars(util.Config.TmpPath, util.Config.TmpPath, gitSshCommand) + cmd.Env = t.envVars(util.Config.TmpPath, util.Config.TmpPath, &gitSshCommand) repoURL, repoTag := t.repository.GitUrl, "master" if split := strings.Split(repoURL, "#"); len(split) > 1 { @@ -263,7 +263,7 @@ func (t *task) runGalaxy() error { cmd.Dir = util.Config.TmpPath + "/repository_" + strconv.Itoa(t.repository.ID) gitSshCommand := "ssh -o StrictHostKeyChecking=no -i " + t.repository.SshKey.GetPath() - cmd.Env = t.envVars(util.Config.TmpPath, cmd.Dir, gitSshCommand) + cmd.Env = t.envVars(util.Config.TmpPath, cmd.Dir, &gitSshCommand) if _, err := os.Stat(cmd.Dir + "/roles/requirements.yml"); err != nil { return nil @@ -325,8 +325,8 @@ func (t *task) runPlaybook() error { func (t *task) envVars(home string, pwd string, gitSshCommand *string) []string { env := os.Environ() - env = append(env, fmt.Sprintf("HOME=%s", util.Config.TmpPath)) - env = append(env, fmt.Sprintf("PWD=%s", cmd.Dir)) + env = append(env, fmt.Sprintf("HOME=%s", home)) + env = append(env, fmt.Sprintf("PWD=%s", pwd)) env = append(env, fmt.Sprintln("PYTHONUNBUFFERED=1")) //env = append(env, fmt.Sprintln("GIT_FLUSH=1"))