echo-e"\n${INFO_COLOR}Checking deployment of services [ ${SERVICES_TO_CHECK}]..${NULL_COLOR}\n"
echo-e"\n${INFO_COLOR}Checking deployment of services [${NULL_COLOR}${SERVICES_TO_CHECK}${INFO_COLOR}] ..${NULL_COLOR}\n"
for serviceToCheck in${SERVICES_TO_CHECK}
do
echo-e"\n${INFO_COLOR}Checking deployment of service ${serviceToCheck}..${NULL_COLOR}"
echo-e" ${INFO_COLOR}retries ${STATUS_CHECK_RETRIES}, interval ${STATUS_CHECK_INTERVAL}, min. hits \
${STATUS_CHECK_MIN_HITS}${NULL_COLOR}\n"
echo-e"${INFO_COLOR}Checking deployment of service ${NULL_COLOR}${serviceToCheck}${INFO_COLOR} ..${NULL_COLOR}"
echo-e" ${INFO_COLOR}retries ${NULL_COLOR}${STATUS_CHECK_RETRIES}${INFO_COLOR}, interval ${NULL_COLOR}${STATUS_CHECK_INTERVAL}${INFO_COLOR}s, min. status hits ${NULL_COLOR}${STATUS_CHECK_MIN_HITS}\n"
checkDeployCmd="\
docker stack ls > /dev/null 2> /dev/null ; \
@@ -44,7 +43,7 @@ do
hits=\$((\${hits} + 1)) && \
if [ \"\${hits}\" -eq \"${STATUS_CHECK_MIN_HITS}\" ] ; \
then \
echo -e \"\\n${PASS_COLOR}Service ${serviceToCheck} is running!${NULL_COLOR}\" && \
echo -e \"\\n${PASS_COLOR}Service ${NULL_COLOR}${serviceToCheck}${PASS_COLOR} is running!${NULL_COLOR}\" && \
echo -e \" got ${PASS_COLOR}\${hits}/${STATUS_CHECK_MIN_HITS}${NULL_COLOR} status hits\" && \
exit 0 ; \
fi ; \
@@ -53,7 +52,7 @@ do
fi ; \
sleep ${STATUS_CHECK_INTERVAL} ; \
done ; \
echo -e \"\\n${FAIL_COLOR}Service ${serviceToCheck} is not running!${NULL_COLOR}\" && \
echo -e \"\\n${FAIL_COLOR}Service ${NULL_COLOR}${serviceToCheck}${PASS_COLOR} is not running!${NULL_COLOR}\" && \
echo -e \" got ${FAIL_COLOR}\${hits}/${STATUS_CHECK_MIN_HITS}${NULL_COLOR} status hits\" && \
echo-e"${INFO_COLOR}If using standard Docker environment:${NULL_COLOR}"
echo-e" ${FAIL_COLOR}You must define 'SERVICE' in environment, with the name of service to run (as defined in \
compose files, like 'service-to-deploy')${NULL_COLOR}"
echo-e" ${FAIL_COLOR}You must define 'SERVICE' in environment, with the name of service to run (as defined in compose files, like 'service-to-deploy')${NULL_COLOR}"
echo-e"${INFO_COLOR}If using Docker Swarm environment:${NULL_COLOR}"
echo-e" ${FAIL_COLOR}You must define 'STACK' in environment, with the name of stack to deploy (stack will \
include all services defined in compose files)${NULL_COLOR}"
echo-e" ${FAIL_COLOR}You must define 'STACK' in environment, with the name of stack to deploy (stack will include all services defined in compose files)${NULL_COLOR}"
exit 1
fi
echo-e"\n${INFO_COLOR}Preparing connection to remote target ..${NULL_COLOR}\n"