Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ inputs:
default: false
args:
description: 'Command arguments for deployment'
trace:
description: 'Log every execution step for detailed tracing (default: false)'
default: false
debug:
description: 'Enable debug mode to include additional debugging messages (default: true)'
description: 'Include additional debugging information in the logs (default: false)'
default: false

runs:
Expand Down
4 changes: 4 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export WORKDIR

. $WORKDIR/scripts/functions.sh

if is_trace; then
set -x
fi

if [ -z "$INPUT_REMOTE_DOCKER_PORT" ]; then
INPUT_REMOTE_DOCKER_PORT=22
fi
Expand Down
3 changes: 3 additions & 0 deletions scripts/docker_compose.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/sh
set -eu
. $WORKDIR/scripts/functions.sh
if is_trace; then
set -x
fi

STACK_FILE=${INPUT_STACK_FILE_PATH}
DOCKER_OPTIONS=" --log-level debug"
Expand Down
3 changes: 3 additions & 0 deletions scripts/docker_secrets.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/sh
set -eu
. $WORKDIR/scripts/functions.sh
if is_trace; then
set -x
fi

get_service_secrets() {
service_name=$1
Expand Down
3 changes: 3 additions & 0 deletions scripts/docker_swarm.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/sh
set -eu
. $WORKDIR/scripts/functions.sh
if is_trace; then
set -x
fi

DOCKER_OPTIONS=" --log-level debug"

Expand Down
7 changes: 7 additions & 0 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ copy_ssh(){
scp $verbose_arg -P "$SSH_PORT" "$local_file" "$DOCKER_USER_HOST:$remote_file" 2>&1
}

is_trace() {
if [ -z "${INPUT_TRACE+set}" ] || [ "$INPUT_TRACE" != "true" ]; then
return 1
fi
return 0
}

is_debug() {
if { [ -z "${INPUT_DEBUG+set}" ] || [ "$INPUT_DEBUG" != "true" ]; } && { [ -z "${RUNNER_DEBUG+set}" ] || [ "$RUNNER_DEBUG" != "1" ]; }; then
return 1
Expand Down