Loading script/_check-deploy.sh +2 −4 Original line number Diff line number Diff line Loading @@ -10,8 +10,7 @@ do echo -e " ${INFO_COLOR}retries ${DATA_COLOR}${STATUS_CHECK_RETRIES}${INFO_COLOR}, interval ${DATA_COLOR}${STATUS_CHECK_INTERVAL}${INFO_COLOR}s, hits ${DATA_COLOR}${STATUS_CHECK_MIN_HITS}${NULL_COLOR}" checkDeployCmd="\ docker stack ls > /dev/null 2> /dev/null ; \ if [ \"\${?}\" -eq \"0\" ] ; \ if docker stack ls > /dev/null 2> /dev/null ; \ then \ swarmMode=true ; \ fi ; \ Loading Loading @@ -42,8 +41,7 @@ do statusCheckCmd=\"[ \${serviceContainerId:-_} = \${runningService:--} -o \ \${serviceContainerId:-_} = \${successfullyExitedService:--} ]\" ; \ fi ; \ eval \"\${statusCheckCmd}\" ; \ if [ \"\${?}\" -eq \"0\" ] ; \ if eval \"\${statusCheckCmd}\" ; \ then \ echo -e \"${PASS_COLOR}[PASS]${NULL_COLOR}\" && \ hits=\$((\${hits} + 1)) && \ Loading script/_do-deploy.sh +9 −10 Original line number Diff line number Diff line Loading @@ -5,20 +5,19 @@ echo -e "\n${INFO_COLOR}Deploying at remote target ..${NULL_COLOR}\n" deployCmd="\ cd ${DEPLOY_HOME} && \ docker login -u ${REGISTRY_USER} -p ${CI_JOB_TOKEN} ${CI_REGISTRY} && \ docker stack ls > /dev/null 2> /dev/null ; \ if [ \"\${?}\" -ne \"0\" ] ; \ if docker stack ls > /dev/null 2> /dev/null ; \ then \ composeFileSplitted=\$(echo ${COMPOSE_FILE} | sed 's/:/ -c /g') && \ env -i \$(grep -v '^#\\| ' .env | xargs) \ docker stack deploy -c \${composeFileSplitted} --with-registry-auth ${STACK:-${SERVICE}} ; \ else \ docker-compose stop ${SERVICE} && \ docker-compose rm -f ${SERVICE} && \ docker-compose pull ${SERVICE} && \ docker-compose up -d ${SERVICE} && \ rm ${DEFAULT_DEPLOY_FILES} ; \ else \ composeFileSplitted=\$(echo ${COMPOSE_FILE} | sed 's/:/ -c /g') && \ env -i \$(grep -v '^#\\| ' .env | xargs) \ docker stack deploy -c \${composeFileSplitted} --with-registry-auth ${STACK:-${SERVICE}} && \ rm ${DEFAULT_DEPLOY_FILES} ; \ fi\ docker-compose up -d ${SERVICE} ; \ fi ; \ cd .. && \ rm -rf ${DEPLOY_HOME}\ " ssh ${SSH_PARAMS} "${SSH_REMOTE}" "${deployCmd}" script/_prepare-deploy.sh +6 −5 Original line number Diff line number Diff line Loading @@ -27,16 +27,17 @@ echo -e "\n${INFO_COLOR}Checking deploy configuration in docker-compose files .. echo -e " ${INFO_COLOR}compose files [ ${DATA_COLOR}${COMPOSE_FILE}${INFO_COLOR} ]${NULL_COLOR}" # Antes de continuar, se comprueba que la configuración de despliegue sea válida. docker-compose config > /dev/null if [ "${?}" -ne "0" ] if docker-compose config > /dev/null then echo -e "${PASS_COLOR}Valid docker-compose configuration!${NULL_COLOR}" else echo -e "${FAIL_COLOR}Invalid docker-compose configuration!${NULL_COLOR}" exit 1 else echo -e "${PASS_COLOR}Valid docker-compose configuration!${NULL_COLOR}" fi DEPLOY_HOME="${DEPLOY_PATH}/docker/${STACK:-${SERVICE}}" randomValue="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)" DEPLOY_HOME="${DEPLOY_PATH}/docker-deploy/${randomValue}" echo -e "\n${INFO_COLOR}Sending deploy resources to remote ..${NULL_COLOR}" echo -e " ${INFO_COLOR}deploy path [ ${DATA_COLOR}${DEPLOY_HOME}${INFO_COLOR} ]${NULL_COLOR}" Loading script/create-nets.sh +1 −2 Original line number Diff line number Diff line Loading @@ -21,8 +21,7 @@ createNetsCmd="${createNetsCmd} :" createNetsInRemoteCmd="\ createNetCmd=\"docker network create\" && \ docker stack ls > /dev/null 2> /dev/null ; \ if [ \"\${?}\" -eq \"0\" ] ; \ if docker stack ls > /dev/null 2> /dev/null ; \ then \ createNetCmd=\"\${createNetCmd} -d overlay --attachable\" ; \ fi ; \ Loading Loading
script/_check-deploy.sh +2 −4 Original line number Diff line number Diff line Loading @@ -10,8 +10,7 @@ do echo -e " ${INFO_COLOR}retries ${DATA_COLOR}${STATUS_CHECK_RETRIES}${INFO_COLOR}, interval ${DATA_COLOR}${STATUS_CHECK_INTERVAL}${INFO_COLOR}s, hits ${DATA_COLOR}${STATUS_CHECK_MIN_HITS}${NULL_COLOR}" checkDeployCmd="\ docker stack ls > /dev/null 2> /dev/null ; \ if [ \"\${?}\" -eq \"0\" ] ; \ if docker stack ls > /dev/null 2> /dev/null ; \ then \ swarmMode=true ; \ fi ; \ Loading Loading @@ -42,8 +41,7 @@ do statusCheckCmd=\"[ \${serviceContainerId:-_} = \${runningService:--} -o \ \${serviceContainerId:-_} = \${successfullyExitedService:--} ]\" ; \ fi ; \ eval \"\${statusCheckCmd}\" ; \ if [ \"\${?}\" -eq \"0\" ] ; \ if eval \"\${statusCheckCmd}\" ; \ then \ echo -e \"${PASS_COLOR}[PASS]${NULL_COLOR}\" && \ hits=\$((\${hits} + 1)) && \ Loading
script/_do-deploy.sh +9 −10 Original line number Diff line number Diff line Loading @@ -5,20 +5,19 @@ echo -e "\n${INFO_COLOR}Deploying at remote target ..${NULL_COLOR}\n" deployCmd="\ cd ${DEPLOY_HOME} && \ docker login -u ${REGISTRY_USER} -p ${CI_JOB_TOKEN} ${CI_REGISTRY} && \ docker stack ls > /dev/null 2> /dev/null ; \ if [ \"\${?}\" -ne \"0\" ] ; \ if docker stack ls > /dev/null 2> /dev/null ; \ then \ composeFileSplitted=\$(echo ${COMPOSE_FILE} | sed 's/:/ -c /g') && \ env -i \$(grep -v '^#\\| ' .env | xargs) \ docker stack deploy -c \${composeFileSplitted} --with-registry-auth ${STACK:-${SERVICE}} ; \ else \ docker-compose stop ${SERVICE} && \ docker-compose rm -f ${SERVICE} && \ docker-compose pull ${SERVICE} && \ docker-compose up -d ${SERVICE} && \ rm ${DEFAULT_DEPLOY_FILES} ; \ else \ composeFileSplitted=\$(echo ${COMPOSE_FILE} | sed 's/:/ -c /g') && \ env -i \$(grep -v '^#\\| ' .env | xargs) \ docker stack deploy -c \${composeFileSplitted} --with-registry-auth ${STACK:-${SERVICE}} && \ rm ${DEFAULT_DEPLOY_FILES} ; \ fi\ docker-compose up -d ${SERVICE} ; \ fi ; \ cd .. && \ rm -rf ${DEPLOY_HOME}\ " ssh ${SSH_PARAMS} "${SSH_REMOTE}" "${deployCmd}"
script/_prepare-deploy.sh +6 −5 Original line number Diff line number Diff line Loading @@ -27,16 +27,17 @@ echo -e "\n${INFO_COLOR}Checking deploy configuration in docker-compose files .. echo -e " ${INFO_COLOR}compose files [ ${DATA_COLOR}${COMPOSE_FILE}${INFO_COLOR} ]${NULL_COLOR}" # Antes de continuar, se comprueba que la configuración de despliegue sea válida. docker-compose config > /dev/null if [ "${?}" -ne "0" ] if docker-compose config > /dev/null then echo -e "${PASS_COLOR}Valid docker-compose configuration!${NULL_COLOR}" else echo -e "${FAIL_COLOR}Invalid docker-compose configuration!${NULL_COLOR}" exit 1 else echo -e "${PASS_COLOR}Valid docker-compose configuration!${NULL_COLOR}" fi DEPLOY_HOME="${DEPLOY_PATH}/docker/${STACK:-${SERVICE}}" randomValue="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)" DEPLOY_HOME="${DEPLOY_PATH}/docker-deploy/${randomValue}" echo -e "\n${INFO_COLOR}Sending deploy resources to remote ..${NULL_COLOR}" echo -e " ${INFO_COLOR}deploy path [ ${DATA_COLOR}${DEPLOY_HOME}${INFO_COLOR} ]${NULL_COLOR}" Loading
script/create-nets.sh +1 −2 Original line number Diff line number Diff line Loading @@ -21,8 +21,7 @@ createNetsCmd="${createNetsCmd} :" createNetsInRemoteCmd="\ createNetCmd=\"docker network create\" && \ docker stack ls > /dev/null 2> /dev/null ; \ if [ \"\${?}\" -eq \"0\" ] ; \ if docker stack ls > /dev/null 2> /dev/null ; \ then \ createNetCmd=\"\${createNetCmd} -d overlay --attachable\" ; \ fi ; \ Loading