Read port environment variable when copying circle ci artifacts to a host machine.

This commit is contained in:
casey langen 2021-02-23 22:16:48 -08:00
parent 5aa8ddb14a
commit e7319ae726

View File

@ -10,6 +10,10 @@ if [[ -z "${MUSIKCUBE_BUILD_HOST_PW}" ]]; then
exit
fi
if [[ -z "${MUSIKCUBE_BUILD_HOST_PORT}" ]]; then
MUSIKCUBE_BUILD_HOST_PORT=22
fi
GLOB=${1}
if [[ -z "${GLOB}" ]]; then
@ -20,5 +24,5 @@ fi
echo "copying build artifacts to host..."
echo " from: ${GLOB}"
ls -al "${GLOB}"
sshpass -p ${MUSIKCUBE_BUILD_HOST_PW} scp -o StrictHostKeyChecking=no "${GLOB}" build@${MUSIKCUBE_BUILD_HOST_IP}:/home/build/ 2> /dev/null
sshpass -p ${MUSIKCUBE_BUILD_HOST_PW} scp -P ${MUSIKCUBE_BUILD_HOST_PORT} -o StrictHostKeyChecking=no "${GLOB}" build@${MUSIKCUBE_BUILD_HOST_IP}:/home/build/ 2> /dev/null
echo "finished copying build artifacts."