shell 一鍵部署

#!/bin/bash
# 把靜態文件push到服務器倉庫上
echo "******正在push static to server******"
cd /home/lufeng/assets
git push origin master
# 把工程文件push到服務器倉庫上
echo "******正在push projects to server******"
cd /home/lufeng/projects/dashixiong
git push origin master 
echo "******已登錄遠程服務器******"
ssh -tt rockcy << remotessh
# 合併倉庫代碼
echo "******合併倉庫代碼******" 
cd /home/static/kaisa_static
git pull origin master
cd
cd /home/projects/dashixiong
git pull origin master
echo "******更新成功******"
exit

remotessh


參考鏈接:http://www.3mu.me/linux%E4%B8%AD%E7%9A%84shell%E7%94%A8ssh%E8%87%AA%E5%8A%A8%E7%99%BB%E5%BD%95%E8%BF%9C%E7%A8%8B%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%90%8E%E6%89%A7%E8%A1%8C%E5%91%BD%E4%BB%A4%E5%B9%B6%E8%87%AA%E5%8A%A8/

http://www.ibm.com/developerworks/cn/aix/library/0909_jinjh_unixlogin/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章