Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable trace for docker login. #285

Merged
merged 1 commit into from
Dec 13, 2023
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
15 changes: 10 additions & 5 deletions tools/travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ export OPENWHISK_HOME=$WHISKDIR

IMAGE_PREFIX="testing"

# 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
13 changes: 10 additions & 3 deletions tools/travis/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,16 @@ elif [ ${RUNTIME_VERSION} == "16" ]; then
RUNTIME="nodejs20"
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