#!/bin/sh

jenkins_host=192.168.192.191
target_host=$1

function copy_to()
{
	module=$1
	scp /home/quant_group/jenkins/workspace/update_test-config-manager/${module}.${target_host}.tgz root@${target_host}:/home/quant_group/deploy_backup/${module}/
	scp /home/quant_group/jenkins/workspace/build_${module}/target/*.jar root@${target_host}:/home/quant_group/deploy_backup/${module}/
}

if [[ "${module_name}" = "ALL" ]]
then
	modules='di-ting du-jiang-yan han-gu-guan jian-men-guan mall pay-center quartz xyqb'
	for module in $modules
	do
	    copy_to ${module}
        echo ${module}
	done
elif [[ "${module_name}" = "" ]]
then
   echo 'Fail module name is empty'
   exit -1
else
	copy_to ${module_name}
 	echo ${module_name}
fi