vlad-git
vlad-git copied to clipboard
Problem width deploys after update to 2.2.0
After updating to 2.2.0 deploys no longer update app to latest code in repository. I have reverted to 2.1.0 for now as the only way to resolve is to manually clear the scm directory on the server that you are deploying to.
Any ideas?
Kind regards,
Jamie
Hi Jamie,
Sorry you're having trouble. Can you post some more info, like the output of running;
rake -t vlad:update
Feel free to scrub private info or message me directly.
Running rake -t vlad:update gives the following (sensitive data removed):
ssh [email protected] 'if cd /home/thedomain.com/scm/repo && git rev-parse master && git remote -v | grep -q [email protected]:projects/myproject.git && cd -; then exit 0; else exit 1; fi &>/dev/null'
A bit more info:
** Invoke vlad:update (first_time) ** Execute vlad:update ssh [email protected] 'if cd /home/domain.com/scm/repo && git rev-parse master && git remote -v | grep -q [email protected]:projects/domain.com.git && cd -; then exit 0; else exit 1; fi &>/dev/null' ssh [email protected] 'cd /home/domain.com/scm && cd /home/domain.com/scm/repo && git checkout -q origin && git fetch && git reset --hard master && git submodule init && git submodule update && git branch -f deployed-master master && git checkout deployed-master && cd - && mkdir -p /home/domain.com/releases/20101110205403 && cd repo && git archive --format=tar deployed-master | (cd /home/domain.com/releases/20101110205403 && tar xf -) && git submodule foreach 'git archive --format=tar $sha1 | (cd /home/domain.com/releases/20101110205403/$path && tar xf -)' && cd - && cd .. && chmod -R g+w /home/domain.com/releases/20101110205403 && rm -rf /home/domain.com/releases/20101110205403/public/system /home/domain.com/releases/20101110205403/log /home/domain.com/releases/20101110205403/tmp/pids && mkdir -p /home/domain.com/releases/20101110205403/tmp /home/domain.com/releases/20101110205403/db' HEAD is now at 78e3d54 Added date to iOS feed Switched to branch 'deployed-master' /home/domain.com/scm /home/domain.com/scm ** Invoke vlad:update_symlinks (first_time) ** Execute vlad:update_symlinks ssh [email protected] 'ln -s /home/domain.com/shared/system /home/domain.com/releases/20101110205403/public/system && ln -s /home/domain.com/shared/log /home/domain.com/releases/20101110205403/log && ln -s /home/domain.com/shared/pids /home/domain.com/releases/20101110205403/tmp/pids' ssh [email protected] 'if ! [ -d /home/domain.com/shared/assets ] ; then mkdir -p /home/domain.com/shared/assets ; fi && if ! [ -d /home/domain.com/shared/public/assets ] ; then mkdir -p /home/domain.com/shared/public/assets ; fi && if ! [ -d /home/domain.com/shared/members/assets ] ; then mkdir -p /home/domain.com/shared/members/assets ; fi && rm -rf /home/domain.com/releases/20101110205403/assets && rm -rf /home/domain.com/releases/20101110205403/public/assets && rm -rf /home/domain.com/releases/20101110205403/members/assets && ln -s /home/domain.com/shared/assets /home/domain.com/releases/20101110205403/assets && ln -s /home/domain.com/shared/public/assets /home/domain.com/releases/20101110205403/public/assets && ln -s /home/domain.com/shared/members/assets /home/domain.com/releases/20101110205403/members/assets' ssh [email protected] 'rm -f /home/domain.com/current && ln -s /home/domain.com/releases/20101110205403 /home/domain.com/current' ssh [email protected] 'echo 201011102054.13 $USER master 20101110205403 >> /home/domain.com//revisions.log'
I actually have this happening with 2.1.0 now which is very odd as I've been using it for over a year with no problems. The only way to get a new release up there now it to delete revisions.log, scm/* and releases/* before doing a deploy?? Any pointers would be greatly appreciated.
Hi there,
vlad-git version 2.1.0 had a bug where code would be exported before it was updated. Old code would be deployed the first time, but deploying a second time would export the correct code. See https://github.com/jbarnette/vlad-git/issues/closed#issue/3
This is fixed in vlad-git 2.2.0.
Try uninstalling all versions of vlad and vlad-git, and then re-installing just the latest versions: gem uninstall vlad gem uninstall vlad-git
gem install vlad
gem install vlad-git
For good measure, delete the /path/to/deploy/scm directory on your remote hosts.
Re-deploy once (which will do a full clone). Then make a trivial code change and deploy again. This second deployment should correctly update your code with a fast checkout.
Cheers, Aaron
Hi Aaron,
Sorry for the slow response, I've had a few rush projects on.
I have just tried this and it doesn't deploy the new version. Reverting to vlad-git 2.1.0 however works fine and deploys the changes, here is what I did:
On vlad-git 2.2.0
rake vlad:deploy
No sign of changes on server so add some text to a file.
git commit -am "Added some text to a file" rake vlad:deploy
Changes not still deployed.
gem uninstall vlad-git gem install vlad-git -v2.1.0 rake vlad:deploy
All deployed fine.
Any ideas?
Many thanks,
Jamie
Hey Jamie, thanks for the info. I'll try to figure out what's going on.
-Aaron
Hey Jamie,
I'm still not able to re-create the bug. I only have easy access to rather new version of git (>1.7). Which version of git are you using?
-Aaron
Hi Aaron,
It's git version 1.7.3.2.
Jamie
Same here. After some heavy rewriting/rebasing I did a git push -f www production:master, triggered the deploy and wondered why those changes didn't make it into the running app. Nothing helped but removing ./scm/repo on the host. I have a couple of apps deployed via Vlad and never experienced this before.
Local: Git 1.7.4.3, vlad 2.2.0, vlad-git 2.2.0, Ruby 1.9.2-p180 Remote (Debian 5): Git 1.5.6.5, vlad 2.2.0, vlad-git 2.2.0, Ruby 1.8.7-p72
Switching back and forth to find a working combination that checks out the latest revision ...
$ rvm use 1.8.7
vlad 2.2.0, vlad-git 2.0.0: OK vlad 2.2.0, vlad-git 2.1.0: OK vlad 2.2.0, vlad-git 2.2.0: nope
$ rvm use 1.9.2
vlad 2.2.0, vlad-git 2.0.0: nope vlad 2.2.0, vlad-git 2.1.0: nope
$ rvm use 1.8.7
vlad 2.2.0, vlad-git 2.2.0: nope vlad 2.2.0, vlad-git 2.1.0: nope O_o vlad 2.2.0, vlad-git 2.0.0: nope =(
$ gem uninstall vlad-git
vlad 2.2.0, vlad-git 2.0.0: OK (hm, even though I'm using Bundler, other versions somehow interfere)
$ rvm use 1.9.2
$ gem uninstall vlad-git
vlad 2.2.0, vlad-git 2.0.0: OK (so both Ruby versions work)
I guess I'll stick to the last configuration for now.
This still isn't working for me, any ideas?
None of us who ran into this problem were able to give a description of how to reliably reproduce this bug, so I guess there is no chance to have it solved in the near future.
Anyway, because of the incompatibility to current Rake versions I finally decided to switch to Capistrano and this was one of the best decisions I ever made. It just works.
Capistrano always seemed a bit bloated to me but if it's the only option I might give it a try. I've tried to track down the bug myself without much luck.
For the record, if I empty the scm directory between deploy all works. Does this shed any light on things?
I mentioned that in this ticket as a workaround but it didn't help to identify the source of the problem.
I suffer from this issue too.
I'm using ruby 2.0.0 vlad 2.5.0
I have git version 1.8.1 installed, and am working on Ubuntu 13.04
When I use vlad-git 2.2.0 and do a rake vlad:update, it doesn't pull through the latest changes.
I just switched to vlad-git 2.1.0 and now the changes come through when I rake vlad:update.
Just want to bump/confirm that this is still a problem. Using:
- Ruby
1.9.3p551
- vlad
2.6.5
- vlad-git
2.2.0