Skip to content

Commit

Permalink
Disable trace for docker login. (ibm-functions#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
falkzoll authored Dec 13, 2023
1 parent 33f091a commit 87a97f6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
15 changes: 10 additions & 5 deletions tools/travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ IMAGE_PREFIX="testing"

export OPENWHISK_HOME=$WHISKDIR

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

# Build OpenWhisk
cd $WHISKDIR
Expand Down
14 changes: 11 additions & 3 deletions tools/travis/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@ elif [ ${RUNTIME_VERSION} == "3.11" ]; then
RUNTIME="python3.11"
fi

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


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

0 comments on commit 87a97f6

Please sign in to comment.