-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize Git clone/checkout #10
Comments
We'll have this very soon. Thanks for pointing it out :) |
On second thoughts, Vlad was very buggy in my experience when using the scm directory and I had to manually empty it in certain situations for the deploy to work. Perhaps a clean checkout as it happens with mina is the best option. |
Hmm, why this bug was closed? |
Renaming this issue to "Optimize Git clone/checkout". I've been thinking about this. Perhaps Not sure on the pitfalls of this yet, though. Definitely up for discussion and experimentation. |
Like the idea of just having a cached repository and cloning from that... would get around some weird issues that occur with Vlad. |
@thelucid Seems good in theory, but I'd like to do some benchmarks. The checking out "process" will still have to be done every time, it's just that you'll be skipping some network I/O, hypothetically. |
@rstacruz But for a big project and on a production server network I/O is costlier than running the "process". Your idea is cool. I just have a small suggestion. I wish if we could create a directory for the first time and check in the code via git clone and if that exists then pull in the directory on subsequent deploys. |
How about just running git clone with |
http://blogs.gnome.org/simos/2009/04/18/git-clones-vs-shallow-git-clones/. I dont think it will be as useful as pull/fetch. |
We'll most likely be implementing something like: (pseudo bash code ahead) if [ ./scm exists ]; then
cd scm && git fetch origin $commit
else
git clone --bare $repository ./scm
fi
if [ $commit is a branch name or a tag name ]; then
git clone ./scm ./tmp/the-current-build --depth 1 --recursive --branch $commit
else
git clone ./scm ./tmp/the-current-build --recursive
cd tmp/the-current-build && git checkout -b new-temp-branch $commit
fi This 'caches' the objects into |
@rstacruz I assume $commit is the last commit during deploy? |
@sarguru It'll be whatever commit you've ran |
Actually, in the interest of optimization, we should probably change the default revision to be deployed as 'HEAD'. |
@rstacruz Agreed. HEAD would be handy on much more use-cases too, in repos where branching is more and revision to be deployed need not be the master. And thanks for the quick replies. Wonderful work. |
Okay, this change makes the default deployable branch By default, Also, it deprecates the old |
Beautiful, nice solution. |
I'm in the process of testing out mina with some existing projects and enjoying it so far.
One downside I have noticed is that it it quite a bit slower than Vlad in some cases as Vlad keeps an "scm" folder on the server so that the whole repository doesn't need to be checked out each deploy, is this something that is planned?
The text was updated successfully, but these errors were encountered: