Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.9k views
in Technique[技术] by (71.8m points)

amazon web services - Elastic Beanstalk "git aws.push" only commited difference?

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)Gitinsh.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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

When you issue git aws.push your entire git repository is zipped and uploaded to Elastic Beanstalk, hence the long push time. That's the way this command is implemented. There's a nice discussion and request for change in this thread.
I'm not sure what files weigh so much in your code, but in general it's best not to store them in the application git.
If these are media files, store them in S3 (or any other web accessible place). If the majority of files are external libs sitting in your git, you can pre-install them by an EB pre-deploy script.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...