With my "unpublished" code changes done, I would like to deploy them to the beta site. I could update the code by logging into the server and checking out the changes, but something more repeatable, without needing to log into the server is preferable.
I opt to use Vlad the Deployer because it was recently updated to version 2. Besides, I already use Capistrano at the day job. I end up regretting the choice after struggling with the setup.
Following Graham Ashton's instructions for deploying Sinatra applications with vlad, I install vlad:
gem install vladThen I update my
Rakefile
to include:beginAnd create
require "vlad"
Vlad.load(:app => nil, :scm => "git")
rescue LoadError
# do nothing
end
config/deploy.rb
with the following:set :application, "eeecooks"The next step should be to run
set :repository, "git://github.com/eee-c/eee-code.git"
set :deploy_to, "/var/www/#{application}"
set :domain, "beta.eeecooks.com"
rake vlad:setup
, but, when I do, I get this output:cstrom@jaynestown:~/repos/eee-code$ rake vlad:setupWha!? The
(in /home/cstrom/repos/eee-code)
rake aborted!
Please specify the server domain via the :domain variable
(See full trace by running task with --trace)
:domain
is clearly set in my deploy.rb
. What's going on there? Even the debug task is screwy:cstrom@jaynestown:~/repos/eee-code$ rake vlad:debugAfter more time than I can to admit, I finally realize that Git support has been removed from vlad core. After installing
(in /home/cstrom/repos/eee-code)
rake aborted!
Please specify the deploy path via the :deploy_to variable
(See full trace by running task with --trace)
vlad-git
via gem install vlad-git
, the vlad setup works as desired:cstrom@jaynestown:~/repos/eee-code$ rake vlad:setup # Setup your servers.And on the beta server:
(in /home/cstrom/repos/eee-code)
cstrom@beta.eeecooks.com's password:
...
sh-3.2$ find /var/www/eeecooks/I am also able to verify that the
/var/www/eeecooks/
/var/www/eeecooks/shared
/var/www/eeecooks/shared/log
/var/www/eeecooks/shared/system
/var/www/eeecooks/shared/pids
/var/www/eeecooks/scm
/var/www/eeecooks/releases
vlad:update
task is working:cstrom@jaynestown:~/repos/eee-code$ rake vlad:updateI still have to get this working with Thin, but that will have to wait until tomorrow.
(in /home/cstrom/repos/eee-code)
cstrom@beta.eeecooks.com's password:
Initialized empty Git repository in /var/www/eeecooks/scm/repo/.git/
Switched to a new branch 'deployed-HEAD'
Thanks for the gem install vlad-git tip, you saved me some time too.
ReplyDeleteHey. Thanks for highlighting the new vlad-git gem. I'll update the original article when I get a spare moment.
ReplyDeleteCheers,
Graham
Graham - thanks for the original article, it was a tremendous help. Glad you found this post. I meant to follow up directly, but totally spaced.
ReplyDeleteThanks for the vlad-git tip, man, this was driving me crazy. Vlad really should put a better message for this, this one is completely misleading.
ReplyDeleteThanks for the tip! Initially, what you said didn't work for me, but after I reinstalled both vlad and vlad-git, it worked. I also uninstalled all my old versions of vlad.
ReplyDeleteOh yah guy - big thanks for the vlad-git hint.
ReplyDeleteAn additional tip if, like me, you are particularly stupid - don't forget to require 'vlad-git' in your Rakefire
ReplyDeleteHi Alex, to me require 'vlad-git' is not needed and it causes error. Just "require 'vlad'" is fine. (FYI: https://github.com/jbarnette/vlad-git)
Delete