我想弄清楚如何使用脚本自动执行此过程。使用shell脚本来自动化git提交和ssh apache服务器部署?
我不知道我会用什么,或如何去做。我期待着指出正确的方向。
在混帐:
git commit -am "my commit"
git pull origin my_branch
git push origin my_branch
git archive --format zip --output /c/git/(environment)_(date)_(commithash).zip my_branch
scp (environment)_(date)_(hash).zip [email protected]:/var/www/html-(domain)
password123
在阿帕奇:(通常我腻子...)
root
password123
cd /var/www/html-(domain)/(environment)
unzip ../(environment)_(date)_(commithash).zip
n
n
A
cd ..
cp -pr (environment) (environment)_(date)_(commithash)
exit
为了解释怎么回事,我推着我的最新承诺, SCP到Apache服务器docroot,部署和使用提交散列进行备份。
你不想要sh,你想要make。 – 2012-08-15 18:09:41
看看[期望](http://www.nist.gov/el/msid/expect.cfm),它可以轻松地为您自动执行重复任务。 – twmb 2012-08-15 21:40:15