Commit 6f48f8af authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Introduce socket SSH para reaprovechar conexiones

parent f222b6c7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -79,3 +79,5 @@ do

	ssh ${SSH_PARAMS} "${SSH_REMOTE}" "${checkDeployCmd}"
done

ssh ${SSH_PARAMS} -q -O exit "${SSH_REMOTE}"
+3 −1
Original line number Diff line number Diff line
@@ -17,5 +17,7 @@ FAIL_COLOR='\033[0;31m'
PASS_COLOR='\033[0;32m'
NULL_COLOR='\033[0m'

SSH_PARAMS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=error"
SSH_PARAMS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=error \
	-o "ControlPath=\"./ssh_connection_socket_%h_%p_%r\"" -o ControlMaster=auto -o ControlPersist=60"

SCRIPTS_PATH="/usr/bin/"
+1 −0
Original line number Diff line number Diff line
@@ -26,5 +26,6 @@ then
else
	echo -e "${FAIL_COLOR}Service deploy failed!${NULL_COLOR}"
	eval "${cleanDeployCmd}"
	ssh ${SSH_PARAMS} -q -O exit "${SSH_REMOTE}"
	exit 1
fi
+2 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ createDirCmd="mkdir -p ${DEPLOY_HOME}"
if ! ssh ${SSH_PARAMS} "${SSH_REMOTE}" ${createDirCmd}
then
	echo -e "${FAIL_COLOR}Deploy path ${DATA_COLOR}${DEPLOY_HOME}${FAIL_COLOR} creation failed!${NULL_COLOR}"
	ssh ${SSH_PARAMS} -q -O exit "${SSH_REMOTE}"
	exit 1
fi

@@ -60,5 +61,6 @@ then
	echo -e "${PASS_COLOR}Deploy resources successfully sent!${NULL_COLOR}"
else
	echo -e "${FAIL_COLOR}Deploy resources sending failed!${NULL_COLOR}"
	ssh ${SSH_PARAMS} -q -O exit "${SSH_REMOTE}"
	exit 1
fi
+1 −0
Original line number Diff line number Diff line
@@ -33,5 +33,6 @@ then
	echo -e "${PASS_COLOR}Network creation was successful!${NULL_COLOR}"
else
	echo -e "${FAIL_COLOR}Network creation failed!${NULL_COLOR}"
	ssh ${SSH_PARAMS} -q -O exit "${SSH_REMOTE}"
	exit 1
fi
Loading