Commit ef6ab4cf authored by Kamil Trzciński's avatar Kamil Trzciński 🔴

Fix bash not executing login shell

parent 62add101
......@@ -59,17 +59,17 @@ func (b *BashShell) GenerateScript(info common.ShellScriptInfo) (*common.ShellSc
io.WriteString(w, "#!/usr/bin/env bash\n")
io.WriteString(w, "\n")
io.WriteString(w, "set -eo pipefail\n")
io.WriteString(w, "\n")
io.WriteString(w, "# save script that is read from to file and execute script file on remote server\n")
io.WriteString(w, fmt.Sprintf("mkdir -p %s\n", helpers.ShellEscape(projectDir)))
io.WriteString(w, fmt.Sprintf("cat > %s && exec /usr/bin/env bash %s; exit 1\n", projectScript, projectScript))
io.WriteString(w, fmt.Sprintf("cat > %s; source %s\n", projectScript, projectScript))
io.WriteString(w, "\n")
if len(build.Hostname) != 0 {
io.WriteString(w, fmt.Sprintf("echo Running on $(hostname) via %s...\n", helpers.ShellEscape(build.Hostname)))
} else {
io.WriteString(w, "echo Running on $(hostname)...\n")
}
io.WriteString(w, "\n")
io.WriteString(w, "set -eo pipefail\n")
io.WriteString(w, "\n")
if build.AllowGitFetch {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment