Merge pull request 'fix: correctly propagate remote command exit status' (#76) from stage into master
Some checks failed
Terraform Apply / Terraform Apply (push) Failing after 19m10s
Some checks failed
Terraform Apply / Terraform Apply (push) Failing after 19m10s
Reviewed-on: #76
This commit was merged in pull request #76.
This commit is contained in:
@@ -97,12 +97,14 @@ remote() {
|
|||||||
|
|
||||||
quoted_cmd="$(printf '%q' "$cmd")"
|
quoted_cmd="$(printf '%q' "$cmd")"
|
||||||
for candidate in "${candidates[@]}"; do
|
for candidate in "${candidates[@]}"; do
|
||||||
if ssh $SSH_OPTS "$candidate@$host_ip" "bash -lc $quoted_cmd"; then
|
ssh $SSH_OPTS "$candidate@$host_ip" "bash -lc $quoted_cmd"
|
||||||
|
rc=$?
|
||||||
|
|
||||||
|
if [ "$rc" -eq 0 ]; then
|
||||||
ACTIVE_SSH_USER="$candidate"
|
ACTIVE_SSH_USER="$candidate"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rc=$?
|
|
||||||
if [ "$rc" -ne 255 ]; then
|
if [ "$rc" -ne 255 ]; then
|
||||||
return "$rc"
|
return "$rc"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user