#!/bin/sh

# 复制项目的文件到对应docker路径，便于一键生成镜像。
usage() {
	echo "Usage: sh copy.sh"
	exit 1
}


# copy sql
echo "begin copy sql "
cp ../sql/wfc_config_db/wfc_config_db.sql ./mysql/db
cp ../sql/wfc_system_db/wfc_system_db.sql ./mysql/db
cp ../sql/wfc_user_db/wfc_user_db.sql ./mysql/db
ln -sf /tmp ./mysql/

# copy html
echo "begin copy system html "
mkdir -p ./nginx/html/dist/sys
rm -rf ./nginx/html/dist/sys/*
cp -rf ../../fe.wfc/dist/* ./nginx/html/dist/sys/

echo "begin copy user html "
mkdir -p ./nginx/html/dist/u
rm -rf ./nginx/html/dist/u/*
cp -rf ../../fe.wfc.user/dist/* ./nginx/html/dist/u/

# copy jar
echo "begin copy wfc-gateway "
cp ../wfc-gateway/target/wfc-gateway.jar ./wfc/gateway/jar

echo "begin copy wfc-auth "
cp ../wfc-auth/target/wfc-auth.jar ./wfc/auth/jar

echo "begin copy wfc-visual "
cp ../wfc-visual/wfc-visual-monitor/target/wfc-visual-monitor.jar  ./wfc/visual/monitor/jar

echo "begin copy wfc-modules-system "
cp ../wfc-modules/wfc-system/target/wfc-modules-system.jar ./wfc/modules/system/jar

echo "begin copy wfc-modules-user "
cp ../wfc-modules/wfc-user/target/wfc-modules-user.jar ./wfc/modules/user/jar

echo "begin copy wfc-modules-file "
cp ../wfc-modules/wfc-file/target/wfc-modules-file.jar ./wfc/modules/file/jar

echo "begin copy wfc-modules-job "
cp ../wfc-modules/wfc-job/target/wfc-modules-job.jar ./wfc/modules/job/jar

echo "begin copy wfc-modules-gen "
cp ../wfc-modules/wfc-gen/target/wfc-modules-gen.jar ./wfc/modules/gen/jar

echo "begin copy wfc-modules-payment "
cp -rf ../wfc-modules/wfc-payment/target/wfc-modules-payment.jar ./wfc/modules/payment/jar
