前端静态文件上传脚本

#!/bin/sh 

//本地目录
Local=/Users/shayne/Documents/work/i4UV2/Code20180512/Apps  
indexHtml=index.html

// sftp上传
sftp root@118.31.103.189 << EOF  
cd /opt/h5/app/view/wx  
lcd ${Local}/weixin/dist  
-put index.html

cd /opt/h5/app/view/app  
lcd ${Local}/weixin_h5/dist  
-put index.html


// 删除原来的js
cd /opt/h5/assets  
rm main_js/*  
rm app_js/*  
lcd ${Local}/weixin/dist/assets  
-put -r main_js
lcd ${Local}/weixin_h5/dist/assets  
-put -r app_js

bye  
EOF


// php缓存清理
ssh dev -T << remotessh  
echo "进入目录"  
cd /opt/h5  
echo "删除缓存"  
sudo rm -rf app/cache/twig/*  
exit  
remotessh  
echo "commit to ftp success"