Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.7k 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...