Commit 3b34452f authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Utiliza ruta variable a grep en todas partes

parent b6b070ed
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
#!/bin/sh

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

echo -e "\n${INFO_COLOR}Checking deployment of services [${DATA_COLOR} ${SERVICES_TO_CHECK} ${INFO_COLOR}] at ${DATA_COLOR}${remoteHost}${INFO_COLOR} ..${NULL_COLOR}"

@@ -36,7 +35,7 @@ do
						replicaStoppedTaskState=\$(docker service ps --format '{{.CurrentState}}' \
							-f 'desired-state=shutdown' -f \"name=\${runningServiceName}.\${j}\" \
							\${runningServiceName} | head -1) ; \
						if echo \"\${replicaStoppedTaskState}\" | grep 'Complete' > /dev/null 2> /dev/null ; \
						if echo \"\${replicaStoppedTaskState}\" | ${GREP_BIN} 'Complete' > /dev/null 2> /dev/null ; \
						then \
							completedTaskCount=\$((\${completedTaskCount} + 1)) ; \
						fi ; \
+2 −0
Original line number Diff line number Diff line
@@ -11,6 +11,8 @@ STATUS_CHECK_INTERVAL="${STATUS_CHECK_INTERVAL:-20}"
STATUS_CHECK_DELAY="${STATUS_CHECK_DELAY:-120}"
STATUS_CHECK_MIN_HITS="${STATUS_CHECK_MIN_HITS:-3}"

GREP_BIN="${GREP_BIN:-grep}"

INFO_COLOR='\033[1;36m'
DATA_COLOR='\033[1;33m'
FAIL_COLOR='\033[0;31m'
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ deployCmd="\
	if docker stack ls > /dev/null 2> /dev/null ; \
	then \
		composeFileSplitted=\$(echo ${COMPOSE_FILE} | sed 's/:/ -c /g') && \
		env -i \$(grep -v '^#\\| ' .env | xargs) \
		env -i \$(${GREP_BIN} -v '^#\\| ' .env | xargs) \
			docker stack deploy -c \${composeFileSplitted} --with-registry-auth ${STACK:-${SERVICE}} ; \
	else \
		docker-compose stop ${SERVICE} && \