basepath=$(cd `dirname $0`; pwd)
echo current path: $basepath

cd $basepath

# 切到env目录下
cd ../../

# 拷贝静态文件到nginx
echo start publishing to nginx...
cp -rf ./nginx/conf/* /usr/local/etc/nginx/
rm -rf /usr/local/Cellar/nginx/1.13.10/html/
mkdir /usr/local/Cellar/nginx/1.13.10/html/
cp -rf ../src/ttk/website/dist/* /usr/local/Cellar/nginx/1.13.10/html/

# 拷贝webapi项目war包到tomcat-webapi目录下
echo start publishing to tomcat...
sudo rm -rf ./tomcat-webapi/webapps/edf-webapi
sudo rm -rf ./tomcat-webapi/webapps/edf-webapi.war
cp -rf ../src/edf/service/edf-webapi/target/edf-webapi.war ./tomcat-webapi/webapps/