Skip to content

Commit 250b34e

Browse files
owineclaude
andcommitted
fix: pass environment variables to remote shell via env command
Fixes SSH heredoc environment variable passing in health-check.sh. Environment variables must be set on the remote side using 'env' command, not on the local side before SSH. This is the same fix applied to deploy-stacks.sh, rollback-stacks.sh, and cleanup-stack.sh in commit d14c671. Resolves docker-piwine-office run #20544121131 failure: '/bin/bash: line 203: local: can only be used in a function' 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent c948927 commit 250b34e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/deployment/health-check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ log_info "Health check timeout: ${HEALTH_TIMEOUT}s, Command timeout: ${COMMAND_T
7878
export OP_SERVICE_ACCOUNT_TOKEN="$OP_TOKEN"
7979

8080
set +e
81-
HEALTH_RESULT=$(ssh_retry 3 5 "OP_SERVICE_ACCOUNT_TOKEN=\"$OP_TOKEN\" HEALTH_TIMEOUT=\"$HEALTH_TIMEOUT\" COMMAND_TIMEOUT=\"$COMMAND_TIMEOUT\" CRITICAL_SERVICES='$CRITICAL_SERVICES' ssh -o \"StrictHostKeyChecking no\" $SSH_USER@$SSH_HOST /bin/bash -s $STACKS \"$HAS_DOCKGE\"" << 'EOF'
81+
HEALTH_RESULT=$(ssh_retry 3 5 "ssh -o \"StrictHostKeyChecking no\" $SSH_USER@$SSH_HOST env OP_SERVICE_ACCOUNT_TOKEN=\"$OP_TOKEN\" HEALTH_TIMEOUT=\"$HEALTH_TIMEOUT\" COMMAND_TIMEOUT=\"$COMMAND_TIMEOUT\" CRITICAL_SERVICES='$CRITICAL_SERVICES' /bin/bash -s $STACKS \"$HAS_DOCKGE\"" << 'EOF'
8282
set -e
8383
8484
# Get arguments passed to script (excluding sensitive OP_TOKEN)

0 commit comments

Comments
 (0)