Skip to content

Commit e90d822

Browse files
committed
refactor(deploy, post_action): enhance container management and streamline post-cleanup logic
• deploy.sh: • Parameterized container naming using ${RUNNER_OS} for clarity in multi-platform scenarios. • Added unset for WHOAMI_VERSION and CONTAINER_NAME to ensure no residual environment variables. • post_action.sh: • Commented out unnecessary rm and related notices, retaining placeholder for future cleanup logic. These changes improve maintainability, adaptability for diverse environments, and ensure clean execution contexts.
1 parent 7d9f6fb commit e90d822

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

deploy.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
# renovate: datasource=docker depname=traefik/whoami versioning=docker
44
WHOAMI_VERSION="v1.10"
5-
docker run --detach --publish-all --name whoami traefik/whoami:"${WHOAMI_VERSION}"
6-
docker stop whoami
7-
docker rm whoami
5+
CONTAINER_NAME="${RUNNER_OS}-whoami"
6+
docker run --detach --publish-all --name "${CONTAINER_NAME}" traefik/whoami:"${WHOAMI_VERSION}"
7+
docker stop "${CONTAINER_NAME}"
8+
docker rm "${CONTAINER_NAME}"
9+
10+
unset WHOAMI_VERSION
11+
unset CONTAINER_NAME

post_action.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
if [ -z "${SSH_KNOWN_HOSTS_FILE}" ]; then
44
echo "::error file=$(basename "$0"),line=${LINENO},endLine=${LINENO},title=Notice::\
55
${SSH_KNOWN_HOSTS_FILE} environment variable must be set."
6-
else
6+
#else
77
# rm -rf "${SSH_KNOWN_HOSTS_FILE}"
88
#echo "::notice file=$(basename "$0"),line=${LINENO},endLine=${LINENO},title=Notice::\
99
#${SSH_KNOWN_HOSTS_FILE} has been removed."

0 commit comments

Comments
 (0)