弹性魔豆"混帐aws.push"只有COMMITED区别? [英] Elastic Beanstalk "git aws.push" only commited difference?

查看:94
本文介绍了弹性魔豆"混帐aws.push"只有COMMITED区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的存储我们在GitHub上的PHP项目。

有关快速部署,我们使用的是.bat文件的混帐推更改AWS弹性魔豆云:

 C:\ Program Files文件(x86)的\ Git的\ BIN \ sh.exe--login -i -c混帐aws.push --environment ENVNAME
 

我们正在推前提交每一次,它的预期工作非常完美。

不幸的是,由于某种原因,有时它是推动非常快(只需按下在PHP code变化的差异),但有时它是发送整个300MB项目(所有媒体)。

有没有什么办法可以混帐推只改变性差异?也许有上推或preparation Git命令的任何其他参数之前送?或者,也许有一些方法来告诉AWS EB去年提交拉来自GitHub的信息库?

感谢您的帮助。

解决方案

确定,之后的麻烦里,我解决了这个问题的原因。

的问题是,对

  aws.push
 

命令弹性魔豆是检查,如果当前的文件被提交到Git的或者他们是领先的存储库。如果你的文件是相同的,以最后的git的承诺,那么EB拉唯一的区别,但如果你的文件处于领先地位的最后的Git提交,然后它的拉动整个文件夹 <! / P>

要避免的问题,我做了一个DEPLOY.BAT文件窗口,试图提交修改aws.push命令之前:

  CLS
git的添加。
git的承诺-a
混帐aws.push --environment myenvironment
暂停
 

现在,如果你已经在运行此.bat文件之前提交,那么你将上传唯一的区别。否则,你会被要求提供一个混帐上传差异之前提交信息。

PS - 请注意,如果你试图将版本已经在EB更多的时间,这也将尝试上传整个文件夹

PSS - 如果以任何理由,你会看到,EB试图拉动整个文件夹,只需关闭窗口,做小的改动源$ C ​​$ C(如添加新行或注释),保存,提交更改Git和再次运行DEPLOY.BAT文件。

工程就像一个魅力!

We are storing our PHP project on github.

For fast deployment we are using .bat file for git pushing changes to AWS Elastic Beanstalk cloud:

"C:\Program Files (x86)\Git\bin\sh.exe" --login -i -c "git aws.push --environment envname"

We are making commit every time before push, and it's working just perfect, as expected.

Unfortunately, for some reason, sometime it is pushing really quick (just pushing difference in PHP Code changes), but sometimes it is sending whole 300mb project (with all media).

Is there any way to git push only changed diference? Maybe there is any additional parameters on push or preparation git commands before send? Or maybe there is some way to tell AWS EB to pull last commit from github repository?

Thanks for any help.

解决方案

OK, after months of troubles I resolved the reason of the problem.

The problem is that on

aws.push

command Elastic Beanstalk is checking if your current files are committed to the git or they are ahead of the repository. If your files are identical to a last git commit, then EB pulls only difference, but if your files are ahead of the last git commit, then it pulls whole folder!

To avoid problem I made a deploy.bat file for windows that tries to commit changes before aws.push command:

cls
git add .
git commit -a
git aws.push --environment myenvironment
pause

Now, if you already did commit before running this .bat file then you will upload only difference. Otherwise, you will be asked for a git commit message before uploading difference.

PS - Please note that if you will try to push version that is already on EB one more time, it will also try to upload entire folder.

PSS - If by any reason you will see that EB tries to pull entire folder, just close the window, make small changes to a source code (like adding new line or a comment), save, commit changes to git and run deploy.bat file again.

Works like a charm!

这篇关于弹性魔豆&QUOT;混帐aws.push&QUOT;只有COMMITED区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆