Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit 87a97f6

Browse files
authored
Disable trace for docker login. (#277)
1 parent 33f091a commit 87a97f6

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

tools/travis/build.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ IMAGE_PREFIX="testing"
1010

1111
export OPENWHISK_HOME=$WHISKDIR
1212

13-
# Login to hub.docker.com to get user specific pull rate.
14-
if [ ! -z "${DOCKER_USER}" ] && [ ! -z "${DOCKER_PASSWORD}" ]; then
15-
echo "Run docker login..."
16-
echo ${DOCKER_PASSWORD} | docker login -u "${DOCKER_USER}" --password-stdin
17-
fi
13+
# run login in a subshell with disabled trace to avoid having credentials in the logs
14+
# when trace is on (set -x)
15+
(
16+
set +x # disable trace in this subshell
17+
# Login to hub.docker.com to get user specific pull rate.
18+
if [ ! -z "${DOCKER_USER}" ] && [ ! -z "${DOCKER_PASSWORD}" ]; then
19+
echo "Run docker login..."
20+
echo ${DOCKER_PASSWORD} | docker login -u "${DOCKER_USER}" --password-stdin
21+
fi
22+
)
1823

1924
# Build OpenWhisk
2025
cd $WHISKDIR

tools/travis/publish.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,17 @@ elif [ ${RUNTIME_VERSION} == "3.11" ]; then
2424
RUNTIME="python3.11"
2525
fi
2626

27-
if [[ ! -z ${DOCKER_USER} ]] && [[ ! -z ${DOCKER_PASSWORD} ]]; then
28-
docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}"
29-
fi
27+
# run login in a subshell with disabled trace to avoid having credentials in the logs
28+
# when trace is on (set -x)
29+
(
30+
set +x # disable trace in this subshell
31+
# Login to hub.docker.com to get user specific pull rate.
32+
if [ ! -z "${DOCKER_USER}" ] && [ ! -z "${DOCKER_PASSWORD}" ]; then
33+
echo "Run docker login..."
34+
echo ${DOCKER_PASSWORD} | docker login -u "${DOCKER_USER}" --password-stdin
35+
fi
36+
)
37+
3038

3139
if [[ ! -z ${RUNTIME} ]]; then
3240
TERM=dumb ./gradlew \

0 commit comments

Comments
 (0)