fix concurrent output in install.sh

This commit is contained in:
Pavel Sviderski
2024-09-21 00:46:58 +10:00
parent d735d568b3
commit 43e2bf86fb
2 changed files with 1 additions and 6 deletions
-4
View File
@@ -37,10 +37,6 @@ func provisionMachine(ctx context.Context, exec sshexec.Executor) error {
"curl -fsSL %s | %s %s bash", sshexec.Quote(installScriptURL), sudoPrefix, sshexec.Quote(env), "curl -fsSL %s | %s %s bash", sshexec.Quote(installScriptURL), sudoPrefix, sshexec.Quote(env),
) )
cmd := sshexec.QuoteCommand("bash", "-c", "set -o pipefail; "+curlBashCmd) cmd := sshexec.QuoteCommand("bash", "-c", "set -o pipefail; "+curlBashCmd)
// TODO: figure out why sometimes the output of `docker version` within the script is intermixed with other
// script output. Note, that the same behavior is observed when using exec.Run but not when running the script
// using ssh CLI. Requesting a pseudo-terminal may help fix this issue:
// session.RequestPty("xterm", 40, 80, ssh.TerminalModes{})
if err = exec.Stream(ctx, cmd, os.Stdout, os.Stderr); err != nil { if err = exec.Stream(ctx, cmd, os.Stdout, os.Stderr); err != nil {
return fmt.Errorf("download and run install script: %w", err) return fmt.Errorf("download and run install script: %w", err)
} }
+1 -2
View File
@@ -11,8 +11,7 @@ UNCLOUD_GROUP="uncloud"
UNCLOUD_GROUP_ADD_USER=${UNCLOUD_GROUP_ADD_USER:-} UNCLOUD_GROUP_ADD_USER=${UNCLOUD_GROUP_ADD_USER:-}
log() { log() {
echo $1 echo -e "\033[1;32m$1\033[0m"
#echo -e "\033[1;32m$1\033[0m" >&2
} }
error() { error() {