Commit 11ea0974 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Merge branch 'dev' into 'master'

Omite parámetro 'prune' de deploy y corrige salida

See merge request redmic-project/docker/docker-deploy!7
parents b1a2640d ce068af2
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -2,13 +2,12 @@

SERVICES_TO_CHECK="${SERVICES_TO_CHECK:-${STACK:-${SERVICE}}}"

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\" && \
		exit 1 \
	"
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ deployCmd="\
	else \
		composeFileSplitted=\$(echo ${COMPOSE_FILE} | sed 's/:/ -c /g') && \
		env -i \$(grep -v '^#\\| ' .env | xargs) \
			docker stack deploy -c \${composeFileSplitted} --prune --with-registry-auth ${STACK:-${SERVICE}} && \
			docker stack deploy -c \${composeFileSplitted} --with-registry-auth ${STACK:-${SERVICE}} && \
		rm ${DEFAULT_DEPLOY_FILES} ; \
	fi\
"
+0 −2
Original line number Diff line number Diff line
@@ -2,8 +2,6 @@

. _definitions.sh

echo -e "\n${INFO_COLOR}Preparing connection to remote target..${NULL_COLOR}\n"

if [ -z "${SSH_REMOTE}" ]
then
	echo -e "${FAIL_COLOR}You must define 'SSH_REMOTE' in environment, with remote user and hostname (like \
+2 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ then
	exit 1
fi

echo -e "\n${INFO_COLOR}Preparing connection to remote target ..${NULL_COLOR}\n"
. _ssh-config.sh

createNetsCmd=""
+4 −5
Original line number Diff line number Diff line
@@ -5,16 +5,15 @@
if [ -z "${SERVICE}" ] && [ -z "${STACK}" ]
then
	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"
. _ssh-config.sh

. _prepare-deploy.sh
+1 −1

File changed.

Contains only whitespace changes.

Loading