Preventing messages showing in case of non existing config.json file
Issue-ID: OOM-2077
Change-Id: Ifb38495d93934b2015893d2c1fc62ec4d480171b
Signed-off-by: Tomáš Levora <t.levora@partner.samsung.com>
docker_login () {
for REGISTRY in $(sed -n '/\.[^/].*\//p' ${1} | sed -e 's/\/.*$//' | sort -u | grep -v ${DEFAULT_REGISTRY}) ${DOCKER_REGISTRY}; do
- if ! grep -wq ${REGISTRY} ~/.docker/config.json; then
+ if ! grep -wqs ${REGISTRY} ~/.docker/config.json; then
echo "Docker login to ${REGISTRY}"
docker login -u "${NEXUS_USERNAME}" -p "${NEXUS_PASSWORD}" ${REGISTRY} > /dev/null
fi