fix: patch set -e out of setup.sh before running
This commit is contained in:
parent
f7689b4d6a
commit
57e0c8798a
1 changed files with 7 additions and 5 deletions
|
|
@ -78,12 +78,14 @@ func InstallNode(node state.Node, apiToken, apiHost, labels string) error {
|
|||
}
|
||||
}()
|
||||
|
||||
// 6. Run setup.sh (ignore env.list error, check for real success)
|
||||
// 6. Run setup.sh (remove set -e to survive env.list deletion)
|
||||
fmt.Printf("[%s] Running setup...\n", node.Name)
|
||||
// Use +e to prevent premature exit on env.list sed failure
|
||||
cmd = exec.Command("bash", "-c",
|
||||
fmt.Sprintf("set +e; bash %s/setup.sh --batch --token %s --cloud %s --custom-ngx-build",
|
||||
DeployTo, apiToken, cloudFromHost(apiHost)))
|
||||
// Patch out set -e so the script doesn't exit on env.list error
|
||||
exec.Command("sed", "-i", "s/^set -e/set +e/", filepath.Join(DeployTo, "setup.sh")).Run()
|
||||
cmd = exec.Command("bash", filepath.Join(DeployTo, "setup.sh"),
|
||||
"--batch", "--token", apiToken, "--cloud", cloudFromHost(apiHost),
|
||||
"--custom-ngx-build",
|
||||
)
|
||||
cmd.Dir = DeployTo
|
||||
|
||||
logFile, _ := os.Create(filepath.Join(DeployTo, "install.log"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue