Code Review
/
releng
/
global-jjb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Chore: Update pre-commit dependencies"
[releng/global-jjb.git]
/
shell
/
docker-login.sh
diff --git
a/shell/docker-login.sh
b/shell/docker-login.sh
index
72d420f
..
d172a3b
100644
(file)
--- a/
shell/docker-login.sh
+++ b/
shell/docker-login.sh
@@
-61,14
+61,12
@@
set_creds() {
USER=$(echo "$CREDENTIAL" | cut -f1 -d:)
PASS=$(echo "$CREDENTIAL" | cut -f2 -d:)
USER=$(echo "$CREDENTIAL" | cut -f1 -d:)
PASS=$(echo "$CREDENTIAL" | cut -f2 -d:)
- if [ -z "$USER" ]
- then
+ if [ -z "$USER" ]; then
echo "ERROR: No user provided"
return 1
fi
echo "ERROR: No user provided"
return 1
fi
- if [ -z "$PASS" ]
- then
+ if [ -z "$PASS" ]; then
echo "ERROR: No password provided"
return 1
fi
echo "ERROR: No password provided"
return 1
fi
@@
-92,10
+90,8
@@
do_login() {
### Main ###
# Loop through Registry and Ports to concatentate and login to nexus
### Main ###
# Loop through Registry and Ports to concatentate and login to nexus
-if [ "${DOCKER_REGISTRY:-none}" != 'none' ]
-then
- for PORT in $REGISTRY_PORTS
- do
+if [ "${DOCKER_REGISTRY:-none}" != 'none' ]; then
+ for PORT in $REGISTRY_PORTS; do
REGISTRY="${DOCKER_REGISTRY}:${PORT}"
# docker login requests an email address if nothing is passed to it
REGISTRY="${DOCKER_REGISTRY}:${PORT}"
# docker login requests an email address if nothing is passed to it
@@
-106,11
+102,9
@@
then
fi
# Login to docker.io after determining if email is needed.
fi
# Login to docker.io after determining if email is needed.
-if [ "${DOCKERHUB_REGISTRY:-none}" != 'none' ]
-then
+if [ "${DOCKERHUB_REGISTRY:-none}" != 'none' ]; then
set_creds "$DOCKERHUB_REGISTRY"
set_creds "$DOCKERHUB_REGISTRY"
- if [ "${DOCKERHUB_EMAIL:-none}" != 'none' ]
- then
+ if [ "${DOCKERHUB_EMAIL:-none}" != 'none' ]; then
do_login "$DOCKERHUB_REGISTRY" "$DOCKERHUB_EMAIL"
else
do_login "$DOCKERHUB_REGISTRY" none
do_login "$DOCKERHUB_REGISTRY" "$DOCKERHUB_EMAIL"
else
do_login "$DOCKERHUB_REGISTRY" none