Re: [capistrano-mailing-list] Is it possible to access the username running the 'cap deploy' task to use it from a cap task in the Capfile?

2014-06-05 Thread Donovan Bray
if it's informational just use the ruby environment accessor. If you need to 
trust it more you should use Lee's method. 

puts "Running user: #{ENV['USER']}"



> On Jun 5, 2014, at 4:30 AM, Simón Muñoz  wrote:
> 
> Hi all,
> 
> Do you know if it's possible to access the username running the 'cap deploy' 
> task to use it from a cap task in the Capfile?
> 
> For example, we need to mark a deploy in newrelic after doing a deploy, so I 
> added a task "mark_deploy" in the capfile that does the work. The problem is 
> that it will be nice to register the user running the 'cap deploy', but for 
> that I need to know the username at the time the "mark" task is invoked.
> 
> Thanks in advance!
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/capistrano/7ee3cb20-4a5b-4e4c-8e30-557ae3e75415%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/4A9C3D96-614F-43FA-BCC7-C04D61164F6E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [capistrano-mailing-list] noting that rvm's optional .ruby-version file can hinder a Capistrano Rails deploy

2014-04-16 Thread Donovan Bray
I don't allow .rvmrc .rbenv-version .ruby-version or .ruby-gemset to be checked 
into the repo. I preemptively add them to the .gitignore even if we don't use 
them.  If developers want them they are allowed to add them with the extension 
.template. Like .ruby-version.template

I also have a rule of no ruby switchers in production. I firmly believe if you 
need a different version of ruby on the box get a different box. I would rather 
deal with server virtualization than with manhandling ruby switchers with 
capistrano and god. Having no ruby switchers in prod provides another layer of 
protection for someone adding the latest flavor of the month ruby switcher file 
into the repo. 

Developers can copy or symlink in their local checkout whichever one they want 
and it doesn't get accidentally checked in and foul everybody else up. It also 
ensures there are no surprises in production by a developer who isn't paying 
attention and something sneaks through peer review. 

I've also been known to leave angry tirades in comments in the template files 
that developers should only change them if they are willing to do ALL of the 
work of upgrading every ruby version in our pre-production, continuous 
integration, and production servers.   

Not surprisingly those files are rarely changed by anybody but me. We have more 
consistency and no more issues caused by differing versions of ruby between 
Dev, pre-prod, and production. 

> On Apr 16, 2014, at 4:02 PM, Gallagher Polyn  
> wrote:
> 
> Was getting deployment failure message rbenv: version `ruby-2.1.0' is not 
> installed, when none of my configuration made reference to that ruby version. 
> But my local dev ruby (2.1.0) had been added to the project repo in a 
> .ruby-version file and after I removed the file from the repo I redeployed 
> successfully.
> 
> Hoping this will prove useful to note for someone in the future.
> 
> Versions:
> Ruby 2.1.0 (recorded on .ruby-version from local dev environment) vs. Ruby 
> 2.1.1 on deployment environment
> Capistrano 3.1
> Rails 4
> Platform:
> Working on OS X 10.8
> Deploying to Ubuntu 12.04 LTS
> Logs:
> INFO [ea6cc465] Running /usr/bin/env sudo /etc/init.d/unicorn_app1_production 
> restart on 33.33.33.33
> DEBUG [ea6cc465] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 
> /usr/bin/env sudo /etc/init.d/unicorn_app1_production restart )
> DEBUG [ea6cc465]  Couldn't reload, starting 'cd /srv/www/app1/current;  
> bundle exec unicorn -D -c /srv/www/app1/shared/config/unicorn.rb -E 
> production' instead
> DEBUG [ea6cc465]  rbenv: version `ruby-2.1.0' is not installed
> DEBUG [ea6cc465]  rbenv: version `ruby-2.1.0' is not installed
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/capistrano/c88b636c-5d9f-424c-84b0-9c83988fcc7f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/6A38FD5C-564B-4D84-9808-EE4B94FC1754%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [capistrano-mailing-list] One task with multiple "ask()" not triggering it more then once

2014-03-31 Thread Donovan Bray
Yor follow up invocations are using variables set to empty strings, you missed 
the leading colon to make them symbols. 

> On Mar 31, 2014, at 6:32 AM, gonace  wrote:
> 
> One task with multiple "ask()" not triggering it more then once
> 
>   task :confirmation do
> if fetch(:stage) == :production then
>   puts <<-WARN
> 
>   
> 
>   WARNING: You're about to perform actions on production server(s)
>   Please confirm that all your intentions are kind and friendly
> 
>   
> 
>   WARN
> 
>   ask(:answer, ' Are you sure you want to continue? (Y) ')
>   if fetch(:answer) == 'Y' then
> set :confirmed, true
>   end
> 
>   unless fetch(:confirmed)
> puts "\nDeploy cancelled!"
> exit
>   end
> end
> 
> 
> if fetch(:stage) != :test then
>   puts <<-WARN
> 
>   
> 
>   GATEWAY: You're about to perform actions on a server(s)
>   that need you to provide gateway credentials.
> 
>   
> 
>   WARN
> 
>   gateway_username = ''
>   gateway_password = ''
> 
>   ask(gateway_username, ' Username: ')
>   ask(gateway_password, ' Password: ')
> end
>   end
>   before :starting, :confirmation
> 
> 
> I want to ask the user for gateway credentials (username and password) but 
> also warn about entering a task sequence to a production environment.
> 
> But only the first "ask()" is triggered, no question about username or 
> password is asked the user.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/capistrano/b5c9010b-c059-4380-9418-0b42e323ea67%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/AB21C50B-51BA-4901-AD64-44962C6F24C9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [capistrano-mailing-list] Limiting tasks via ROLES environment varables

2014-02-22 Thread Donovan Bray
look at using hostfilter instead

http://stackoverflow.com/questions/429816/how-to-deploy-to-a-single-specific-server-using-capistrano


On Sat, Feb 22, 2014 at 2:30 AM, Carlos Peñas  wrote:

> Hi
>
> In capistrano 2.15 I'm getting some trouble limiting task execution,
> using ROLES environment variables
>
> if I use ROLES=role and call a task which have some "after" hooks, the
> tasks indicated by these hooks are called regardless the roles indicated
> in the task.
>
> For example in this example cap file:
>
> server "127.0.0.1", :web, :app
> server "127.1.1.1", :app, :db
>
> task :do_all do
>   run "echo hi do all"
> end
>
> task :do_db, :roles => :db do
>   run "echo hi do db"
> end
> after :do_all, :do_db
>
> task :do_app, :roles => :app do
>   run "echo hi do app"
> end
> after :do_all, :do_app
>
> task :do_web, :roles => :db do
>   run "echo hi do web"
> end
> after :do_all, :do_web
>
> If I call ROLES="db" cap do_all
>
> I get:
>
>   * 2014-02-22 11:15:33 executing `do_all'
>   * executing "echo hi do all"
> servers: ["127.1.1.1"]
> Password:
> [127.1.1.1] executing command
>  ** [out :: 127.1.1.1] hi do all
> command finished in 13ms
> triggering after callbacks for `do_all'
>   * 2014-02-22 11:15:44 executing `do_db'
>   * executing "echo hi do db"
> servers: ["127.1.1.1"]
> [127.1.1.1] executing command
>  ** [out :: 127.1.1.1] hi do db
> command finished in 3ms
>   * 2014-02-22 11:15:44 executing `do_app'
>   * executing "echo hi do app"
> servers: ["127.1.1.1"]
> [127.1.1.1] executing command
>  ** [out :: 127.1.1.1] hi do app
> command finished in 3ms
>   * 2014-02-22 11:15:44 executing `do_web'
>   * executing "echo hi do web"
> servers: ["127.1.1.1"]
> [127.1.1.1] executing command
>  ** [out :: 127.1.1.1] hi do web
> command finished in 3ms
>
> So the ROLES variable is limiting the server to apply the tasks but not
> the tasks applied. I'd expected do_all, do_db but not do_web and do_app
>
> Is there a way to achieve the behavior I expected? Im stuck in this
> scheme of after :this, :do_that and I really need do partial task apply
> to a role
>
> Thanks.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capistrano+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/capistrano/5187fb3e-6e14-42ea-82c1-1c162d174d5f%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/CABV8oi%3DUeFprSKx5kj7NG40yMZ6DgQv-J1NKCkGD8ZzKS5mcsw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano-mailing-list] Re: Capistrano is calling rake from /usr/bin/env but rake gem is installed into /usr/local/rvm/gems/ruby-2.1.0/gems/rake-10.1.1

2014-02-01 Thread Donovan Bray
I've been working with ruby and gems since ruby 1.8.7. As I mentioned I
haven't upgraded to Cap 3, all of my infrastructure is built with
capistrano 2, and the cap-recipes gem at
https://github.com/donnoman/cap-recipes

I use custom bundler recipes
https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/bundler/install.rb
ruby:
https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/ruby19/install.rb
passenger:
https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/passenger/install.rb
nginx based passenger:
https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/nginx_passenger/install.rb

among many others.

I have not made the decision to upgrade cap-recipes to cap3.  I don't
particularly like the cap3 dsl. and Cap3 removed some of the items that
allows my recipes to work, like the missing :on hooks. The removal of
method_missing to locate variables increases the level of effort to upgrade
cap-recipes.

I'm considering forking cap2 and renaming it to be a different project to
separate it from cap3.  I haven't made a final decision on it.   I'm going
to finally fork cap-recipes to be it's own gem separate from it's parent
fork, and I may try to upgrade one or two recipes to cap3 to determine the
LOE and see if I can live with the dsl. If I can, then I'll upgrade
cap-recipes to cap3.  If the baby is ugly, then I'll fork cap2.


On Sat, Feb 1, 2014 at 11:15 AM, Douglas Magnenat <
douglas.magne...@gmail.com> wrote:

> Though I agree it is a bad idea to mix different rubies on the same
> server, I disagree not using RVM to install a solo ruby. I spent my weekend
> try to solve gems issues with Phusion Passenger :
>
> 1) Despite I said at the begining of my first post-question. *I finally
> will* use *capistrano-rvm* and *capistrano-bundler*.
> Ruby and gems would give me far more headache if I wouldn't use RVM and
> bundler.
> It doesn't exist proper tutorial on Internet to install ruby taking care
> of ruby locatin, access rights, path, environnement variables, gems
> locations, etc...
> The complexity of ruby environnement appears to be one of the reasons why
> RVM has been developed.
>
> 2) Now without capistrano-bundler having for me generated this complexe
> parametered bundle command ( It s not just a "bundle install") I would have
> spent ages to understand what to do to perform a proper deployment :
> Capistrano and Capistrano-bundler take care of it for me.
>
> 3) As Phusion Passenger is no more installed as a gem but as a package (on
> debian) It also comes with an apt-get dependency : ruby package 1.9.3
> Unfortunately when I installed my ruby version 2.1.0, I thought this was
> the only ruby version installed. This lead me to a pain troubelshooting
> why Phusion passenger was complaining not finding my gems.
> After ours of fighting with gems, I was happy to find a dedicated section
> to RVM into Phusion Passenger guide :
> http://stackoverflow.com/questions/21477087/why-does-passenger-says-that-my-gem-json-cant-be-found-when-my-gem-list-show
>
> To be short, Ruby and his Gems is so much a pain for me (and many
> people I guess) that I'm really happy to have helping tools such as RVM,
> Capistrano and capistrano-bundler to ease my life of developer. So that I
> can concentrate on coding my app.
>
> I'm really gratefull to developers that took time to develop such tools !
> Great thanks !
>
>
> Le samedi 1 février 2014 16:09:11 UTC+1, dbray a écrit :
>>
>> I have a hard fast rule that you should never use rben, rvm or any other
>> ruby switcher on production or staging boxes. Ruby switching is a
>> developers tool. Use one and one only version of ruby on a remote box. If
>> you have two apps that need to use different rubies, and you want to make
>> them work on the same box. Invest the time required to make the code use
>> the same version of ruby instead of futzing with a ruby switcher.  If you
>> can't make them use the same version of ruby, in these days of cloud
>> computing, put the apps on different servers. If you are so hard up for
>> hardware then use something like LXC to provide that isolation.
>>
>> rvm and rbenv are just examples of providing isolation. You can provide
>> isolation by putting them on different servers or virtual servers and you
>> will save yourself a lot of pain, and incidentally downtime. In production
>> I want the fewest dependencies, and when you add a ruby switcher you are
>> adding a very fickle, complicated, and in my experience unstable dependency.
>>
>> That being said, try using the full path to bundle in your rake command.
>>  There are also examples of adding to the path by overriding the call to
>> the default shell.  I don't use cap3 yet so I can only speculate that the
>> following may work in this one instance.  I can pretty much guarantee this
>> won't be the last time using a ruby switcher is going to bite you.
>>
>> SSHKit.config.command_map[:rake] = "/usr/local/rvm/g

Re: [capistrano-mailing-list] Re: Capistrano is calling rake from /usr/bin/env but rake gem is installed into /usr/local/rvm/gems/ruby-2.1.0/gems/rake-10.1.1

2014-02-01 Thread Donovan Bray
I have a hard fast rule that you should never use rbenv, rvm or any other
ruby switcher on production or staging boxes. Ruby switching is a
developers tool. Use one and one only version of ruby on a remote box. If
you have two apps that need to use different rubies, and you want to make
them work on the same box. Invest the time required to make the code use
the same version of ruby instead of futzing with a ruby switcher.  If you
can't make them use the same version of ruby, in these days of cloud
computing, put the apps on different servers. If you are so hard up for
hardware then use something like LXC to provide that isolation.

rvm and rbenv are just examples of providing isolation. You can provide
isolation by putting them on different servers or virtual servers and you
will save yourself a lot of pain, and incidentally downtime. In production
I want the fewest dependencies, and when you add a ruby switcher you are
adding a very fickle, complicated, and in my experience unstable dependency.

That being said, try using the full path to bundle in your rake command.
 There are also examples of adding to the path by overriding the call to
the default shell.  I don't use cap3 yet so I can only speculate that the
following may work in this one instance.  I can pretty much guarantee this
won't be the last time using a ruby switcher is going to bite you.

SSHKit.config.command_map[:rake] =
"/usr/local/rvm/gems/ruby-2.1.0/bin/bundle exec rake tmp:cache:clear"


On Sat, Feb 1, 2014 at 1:10 AM, Douglas Magnenat  wrote:

> I also got another answer on stackoverflow. I tried your solution and the
> one on Stackoverflow. Both do work.
> So as I don't know if it is linked to this 
> bugreferenced on 
> stackoverflow, so I post the
> link
>  to
> the other answer (just in case)  :
>
> SSHKit.config.command_map[:rake] = "bundle exec rake tmp:cache:clear"
>
>
> Le mercredi 29 janvier 2014 12:13:00 UTC+1, Douglas Magnenat a écrit :
>>
>> *Versions:*
>> Ruby 2.1
>> Capistrano 3.0.1
>> Rake 10.1.1/ Rails 3.2.16 / rvm 1.25.12
>>
>> *I'm using rvm on myserver to facilitate ruby installation, but I install
>> and udate manually the gems with user rvm_admin.*
>> *rvm has been installed 'system wide'.*
>> *I don't use capistrano-rvm and I don't use capistrano-rails, as I
>> manually update ruby, gems, assets, and migrations.*
>>
>>
>> *Platform:*
>> Working on XUbuntu 12.04.4 LTS
>> Deploying to Debian Wheezy
>>
>> Logs:
>>
>>- Please past logs (as completely as possible to a 3rd party pasting
>>service such as pastie.org)
>>
>> Files:
>>
>>- Capfile
>>
>> require 'capistrano/setup'
>> require 'capistrano/deploy'
>> Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
>>
>>- deploy.rb
>>
>> set :application, 'odpf'
>> set :repo_url, 'g...@github.com:myrepo/myapp.git'
>> set :branch, 'production_1.01'
>> set :deploy_to, '/var/www/odpf'
>> set :pty, false
>> set :scm, :git
>> set :format, :pretty
>>
>>
>> namespace :deploy do
>>   desc 'Restart application'
>>   task :restart do
>> on roles(:app), in: :sequence, wait: 5 do
>>   # Your restart mechanism here, for example:
>>   # l'exemple correspond à ce qu'il faut pour restart passenger :
>>   # http://www.modrails.com/documentation/Users%20guide%
>> 20Apache.html#_redeploying_restarting_the_ruby_on_rails_application
>>   execute :mkdir, '-p', "#{release_path}/tmp"
>>   execute :touch, release_path.join('tmp/restart.txt')
>> end
>>   end
>>
>>
>>   after :restart, :clear_cache do
>> on roles(:web), in: :groups, limit: 3, wait: 10 do
>>   # Here we can do anything such as:
>>   # Conformément à : http://guides.rubyonrails.org/
>> v3.2.14/command_line.html#tmp
>>   within release_path do
>> execute :rake, 'tmp:cache:clear'
>>   end
>> end
>>   end
>>
>>
>>   # Create symlink to database.yml after publication
>>   before 'deploy:published', 'db_access:create_symlinks'
>>
>>
>>   after :finishing, 'deploy:cleanup'
>> end
>>
>>- Stage files (production.rb, staging.rb)
>>
>> set :stage, :production
>> server 'myserver.net', user: 'rvm_admin', roles: %w{web app db}
>>
>> set :ssh_options, { forward_agent: true, port:  }
>>
>>
>> When I perform a cap production deploy, It goes well untill the end of
>> the output :
>>
>> INFO [0a0dbcb0] Running /usr/bin/env rake tmp:cache:clear on phisa-odpf-
>> vd.vserver.nimag.net
>> DEBUG [0a0dbcb0] Command: cd /var/www/odpf/releases/20140129101515 &&
>> /usr/bin/env rake tmp:cache:clear
>> DEBUG [0a0dbcb0] /usr/bin/env: rake
>> DEBUG [0a0dbcb0] : Aucun fichier ou dossier de ce type
>> cap aborted!
>> rake stdout: Nothing written
>> rake stderr: Nothing written
>> /home/douglas/.rvm/gems/ruby-2.1.0@rails3/gems/sshkit-1.0.0/lib/sshkit/
>> command.rb:94:in `exit_status='
>> /home/douglas/.

Re: [capistrano-mailing-list] Capistrano 2.11.2 briefly turn off rollback

2013-12-17 Thread Donovan Bray
Add this to your deploy.rb and unrem as necessary. 

  # #For troubleshooting only
  # namespace :deploy do
  #   task :update_code, :except => { :no_release => true } do
  # #on_rollback { run "rm -rf #{release_path}; true" }
  # strategy.deploy!
  # finalize_update
  #   end
  # end


> On Dec 17, 2013, at 12:08 PM, Vell  wrote:
> 
> Versions:
> Ruby 1.9.2p320
> Capistrano 2.11.2
> Rake / Rails / etc  Rake 9.2.2/Rails 3.2.13
> Platform:
> Working on CentOS release 6.
> Deploying to...
> Logs:
>  ** [out :: rails-192-vmware] ArgumentError: invalid byte sequence in US-ASCII
>  ** [out :: rails-192-vmware] An error occured while installing thor 
> (0.18.1), and Bundler cannot continue.
>  ** [out :: rails-192-vmware] Make sure that `gem install thor -v '0.18.1'` 
> succeeds before bundling.
> command finished in 46213ms
> *** [deploy:update_code] rolling back
> 
> Files:
> Capfile
> deploy.rb
> Stage files (production.rb, staging.rb)
> Hello all,
> 
> I am trying to understand how I can briefly turn off the rollback feature for 
> capistrano 2.11.2 so that I can figure what the error is that occurred with a 
> gem install during bundle install.
> 
> As it stands, I was able to install thor using gem install but yet bundler is 
> still complaining. Is there a way that I can turn that I can turn off the 
> rollback so that I can fun the specific common din the cap file and see what 
> the complaint is?
> 
> Thanks
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/capistrano/d240a995-d4fb-4148-918a-7c55973c01b7%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/DD0C0A8B-1010-47CF-BE25-73CE4149D42D%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano-mailing-list] Valid Password entered in capistrano does not work

2013-12-02 Thread Donovan Bray
what happens when you run this on the host
xnet241.hamilton.harte-lyne.ca instead
of your deploy host.


On Mon, Dec 2, 2013 at 6:00 PM, byrnejb  wrote:

>
>
> On Monday, 2 December 2013 17:22:53 UTC-5, dbray wrote:
>>
>> That's a peculiar invocation, use a debugger to make sure :scm_password
>> is set the way you think it is.
>>
>> Or try:
>>
>> set(:scm_password) { 
>> Capistrano::CLI.password_prompt("#{scm_user}@#{scm_server}
>> password: ")}
>>
>> The form you suggested gives exactly the same behaviour as the one we
> were already using.
>
> I have also verified that the contents of scm_password is indeed the same
> as what is input.  I even replaced the block prompt assignment with a
> string literal:
>
>   set( :scm_password, "the_actual_password" )
>
> and got exactly the same results.
>
> The error string looks like this:
> failed: "env HLL_DB_ENV=production
> PATH=$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH RAILS_ENV=production sh -c
> 'git clone -q -b ForEx-Deploy-V.04.000.rc1 ssh://
> theheart_t...@vcs-git.hamilton.harte-lyne.ca/var/data/vcs-git/hll/hll_th_forex_rss.git/var/data/hll_th_test/hll_th_forex_rss/releases/20131203013423
>  && cd
> /var/data/hll_th_test/hll_th_forex_rss/releases/20131203013423 && git
> checkout -q -b deploy 4a2be6f366c5bb31205713cc73a04a5996c8ed11 && (echo
> 4a2be6f366c5bb31205713cc73a04a5996c8ed11 >
> /var/data/hll_th_test/hll_th_forex_rss/releases/20131203013423/REVISION)'"
> on xnet241.hamilton.harte-lyne.ca
>
> If I run the sh -c command directly on the host that I am running cap
> deploy from I get no error and everything is created as expected:
>
> sh -c 'git clone -q -b ForEx-Deploy-V.04.000.rc1 ssh://
> theheart_t...@vcs-git.hamilton.harte-lyne.ca/var/data/vcs-git/hll/hll_th_forex_rss.git/var/data/hll_th_test/hll_th_forex_rss/releases/20131203013423
>  && cd
> /var/data/hll_th_test/hll_th_forex_rss/releases/20131203013423 && git
> checkout -q -b deploy 4a2be6f366c5bb31205713cc73a04a5996c8ed11 && (echo
> 4a2be6f366c5bb31205713cc73a04a5996c8ed11 >
> /var/data/hll_th_test/hll_th_forex_rss/releases/20131203013423/REVISION)'
>
> I have tried this with set( :deploy_via, "checkout" ) and  set(
> :deploy_via, "remote_cache" ) and both generate the same logon errors.
> The failed instructions for both, although different from each other, work
> perfectly when executed from the user shell on the deployment host.
>
> This has to be an ssh issue of some sort.   Is there any way to get the -v
> switch passed to ssh as used by Capistrano?
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capistrano+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/capistrano/7efb9ac8-35b4-41d8-8122-90644419508e%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/CABV8oin2qM8gshhhvi48ummU4cA%3D5hr_73eC9farb_u6pLQJpg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano-mailing-list] Valid Password entered in capistrano does not work

2013-12-02 Thread Donovan Bray
That's a peculiar invocation, use a debugger to make sure :scm_password is set 
the way you think it is.

Or try:

set(:scm_password) { Capistrano::CLI.password_prompt("#{scm_user}@#{scm_server} 
password: ")}

> On Dec 2, 2013, at 1:21 PM, byrnejb  wrote:
> 
> set( :scm_password,  
>   proc{Capistrano::CLI.password_prompt(
> "#{scm_user}@#{scm_server} password: ")} )

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/AEF1CF13-4E58-4B32-82C6-68CA212B62D2%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano-mailing-list] Re: [capistrano] Capistrano split error

2013-12-02 Thread Donovan Bray
I don't see anything illegal with your naming, though I don't like mixing 
separators. 

Are you sure that branch exists exactly as specified?

What is your repository set as?

Have you verified that you have access to the repository both locally and 
remotely (with the deploy user?)

> On Dec 2, 2013, at 6:24 AM, byrnejb  wrote:
> 
> 
> 
>> On Friday, 29 November 2013 17:42:48 UTC-5, dbray wrote:
>> Split is a string method not an Array method in 1.9.3 nor ruby 2.0
>> 
>> How are you setting the branch to be deployed?
>  
> # Deploy this version. This is an SCM/VCS repository branch, not a tag.
> set( :branch,  "ForEx-Deploy-V.04.000.rc1" )
> 
>> 
>> How are you setting the repo for git?
> 
> # Define VCS/SCM characteristics
> set( :scm, "git" ) 
>  
>> What version of git are you running locally?
> 
>  $ git --version
> git version 1.7.1
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/capistrano/5c2ffa53-df3e-4591-9937-5bf9eb7bb02b%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/D71EDDE8-DB8A-4C50-A5A6-FD95B0321B6F%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] Capistrano split error

2013-11-29 Thread Donovan Bray
Split is a string method not an Array method in 1.9.3 nor ruby 2.0

How are you setting the branch to be deployed?

How are you setting the repo for git?

What version of git are you running locally?

> On Nov 29, 2013, at 1:24 PM, byrnejb  wrote:
> 
> Arch = i86_64
> OS = CentOS-6.4 (RHEL6)
> Ruby = v.2.0.0.p353
> Rails = 4.0.1
> Capistrano 2.15.5
> 
> We are trying to deploy a complex recipe which was last used this past 
> January and worked then without error. At that time we were using Ruby-1.9.3 
> and RoR-3.2.8.  We have updated our application to Ruby-2. and RoR-4.0.1 and 
> have installed Ruby-2.0.0 on the deployment target.  When we do a --dry-run 
> of the deployment we are getting this error:
> 
> from 
> /usr/lib64/ruby/gems/2.0.0/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/scm/git.rb:230:in
>  `query_revision': undefined method `split' for # 
> (NoMethodError)
> .  .  .
> 
> See https://gist.github.com/anonymous/7712107
> 
> It appears to me that this may be related to the empty array at 
> variables.rb:95:
> .  .  .
> from 
> /usr/lib64/ruby/gems/2.0.0/gems/capistrano-2.15.5/lib/capistrano/configuration/variables.rb:110:in
>  `synchronize'
> from 
> /usr/lib64/ruby/gems/2.0.0/gems/capistrano-2.15.5/lib/capistrano/configuration/variables.rb:110:in
>  `protect'
> from 
> /usr/lib64/ruby/gems/2.0.0/gems/capistrano-2.15.5/lib/capistrano/configuration/variables.rb:78:in
>  `fetch'
> from 
> /usr/lib64/ruby/gems/2.0.0/gems/capistrano-2.15.5/lib/capistrano/configuration/variables.rb:95:in
>  `[]'
> from 
> /usr/lib64/ruby/gems/2.0.0/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/strategy/base.rb:86:in
>  `revision'
> 
> Does anyone have any suggestions as to where I should look?  Does this look 
> like a configuration error in deploy.rb?
> 
> This recipe is very, very customized and quite large.  Undertaking a complete 
> rewrite to get it to work with Capistrano 3 is not in the budget.
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] Task fails when called on multiple hosts with :pty true

2013-11-29 Thread Donovan Bray
Let me flip it around on you; what's the point of running the command on all 
the servers inside the block if it's not targeted to the individual server?  If 
it's to gather a value use the capture helper before the block. 

Reminds me of the old joke

Patient: Dr Dr it hurts when I do this
Dr:  Then don't do that. 

> On Nov 29, 2013, at 6:59 AM, Varun Shankar  wrote:
> 
> 
> 
>> On Friday, November 29, 2013 6:31:50 PM UTC+5:30, dbray wrote:
>> The thing you are missing is you have to restrict the inner commands to the 
>> channels server; else cap is going to run your inner commands on all of the 
>> tasks servers again. 
>> 
>> run "sleep 0.1", :pty => true, :hosts => [channel[:server]]
>> 
>  
> Thanks for your reply. I am aware of the problem you mentioned. But what I 
> want to know is, why shall Capistrano fail (IOError) when the inner commands 
> are run on all the servers again?
>  
>>> On Nov 29, 2013, at 3:17 AM, Varun Shankar  wrote:
>>> 
>>> run "sleep 0.1", :pty => true
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] Task fails when called on multiple hosts with :pty true

2013-11-29 Thread Donovan Bray
Sorry I keep noticing different things your role definition is incorrect

Either do

hosts.each do |ip|
  server ip, :app
end

Or more simply

role :app, hosts

As the role helper accepts an array directly

> On Nov 29, 2013, at 3:17 AM, Varun Shankar  wrote:
> 
>   hosts.each do |ip|
> role :app, ip
>   end

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] Task fails when called on multiple hosts with :pty true

2013-11-29 Thread Donovan Bray
The thing you are missing is you have to restrict the inner commands to the 
channels server; else cap is going to run your inner commands on all of the 
tasks servers again. 

run "sleep 0.1", :pty => true, :hosts => [channel[:server]]

> On Nov 29, 2013, at 3:17 AM, Varun Shankar  wrote:
> 
> run "sleep 0.1", :pty => true

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] 'deployment flag requires a Gemfile.lock' seems to frustrate my first attempt to cap deploy:cold

2013-11-05 Thread Donovan Bray
Do an 'ls -lah' inside the release directory and post the results; a mismatch 
in owner should be clearly apparent. 

Make sure you execute the bundle install as the same user as your application 
runner; else chown the release directory and bundle path to your application 
runner after the bundle. 

Why are you using svn for a github repo?

Have you tried setting the :scm to :git, and use remote_cache strategy? It 
should be much faster. 

> On Nov 4, 2013, at 4:26 PM, Gallagher Polyn  wrote:
> 
> Firstly, thanks for your reply.
>  
>> Make sure you didn't .gitignore Gemfile.lock
> 
> No, I checked, and it is not included there.
>  
>> 'bundle install' locally and commit the result. 
> 
> I performed this action, and with a clean working directory the result was 
> the same, unfortunately.
> 
> After further investigation into this and reading this little post, is my 
> issue possibly related to ownership of the lock file on the server? Is is 
> possible that the permission structures are mismatched?
>  
>>> On Nov 1, 2013, at 6:09 PM, Gallagher Polyn  wrote:
>>> 
>>> Hi,
>>> 
>>> Using Capistrano v2.11.2 and Ruby 2.0.0p247 and attempting cap deploy:cold, 
>>> it seems I encounter a hiccup related to some improper digestion of 
>>> Gemfile.lock.
>>> 
>>> Here is a gist with my Capfile, deploy.rb and the readout resulting from 
>>> the command: https://gist.github.com/gpolyn/0c7d35e52c81b8b53032
>>> 
>>> …it seems to me that the problem is encountered here...
>>> 
>>> [localhost] sh -c 'cd /var/massiveapp/releases/20131102003502 && bundle 
>>> install --gemfile /var/massiveapp/releases/20131102003502/Gemfile --path 
>>> /var/massiveapp/shared/bundle --deployment --quiet --without development 
>>> test'
>>>  ** [out :: localhost] The --deployment flag requires a Gemfile.lock. 
>>> Please make sure you have checked
>>>  ** [out :: localhost] your Gemfile.lock into version control before 
>>> deploying.
>>> command finished in 112ms
>>> *** [deploy:update_code] rolling back
>>> 
>>> …though a (possibly unrelated) failure follows later...
>>> 
>>> failed: "sh -c 'cd /var/massiveapp/releases/20131102003502 && bundle 
>>> install --gemfile /var/massiveapp/releases/20131102003502/Gemfile --path 
>>> /var/massiveapp/shared/bundle --deployment --quiet --without development 
>>> test'" on localhost
> 
>  
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] 'deployment flag requires a Gemfile.lock' seems to frustrate my first attempt to cap deploy:cold

2013-11-04 Thread Donovan Bray
It's telling you you didn't check in your Gemfile.lock to begin with. 

Make sure you didn't .gitignore Gemfile.lock

'bundle install' locally and commit the result. 

> On Nov 1, 2013, at 6:09 PM, Gallagher Polyn  wrote:
> 
> Hi,
> 
> Using Capistrano v2.11.2 and Ruby 2.0.0p247 and attempting cap deploy:cold, 
> it seems I encounter a hiccup related to some improper digestion of 
> Gemfile.lock.
> 
> Here is a gist with my Capfile, deploy.rb and the readout resulting from the 
> command: https://gist.github.com/gpolyn/0c7d35e52c81b8b53032
> 
> …it seems to me that the problem is encountered here...
> 
> [localhost] sh -c 'cd /var/massiveapp/releases/20131102003502 && bundle 
> install --gemfile /var/massiveapp/releases/20131102003502/Gemfile --path 
> /var/massiveapp/shared/bundle --deployment --quiet --without development test'
>  ** [out :: localhost] The --deployment flag requires a Gemfile.lock. Please 
> make sure you have checked
>  ** [out :: localhost] your Gemfile.lock into version control before 
> deploying.
> command finished in 112ms
> *** [deploy:update_code] rolling back
> 
> …though a (possibly unrelated) failure follows later...
> 
> failed: "sh -c 'cd /var/massiveapp/releases/20131102003502 && bundle install 
> --gemfile /var/massiveapp/releases/20131102003502/Gemfile --path 
> /var/massiveapp/shared/bundle --deployment --quiet --without development 
> test'" on localhost
> 
> Thanks for any light readers can shed.
> 
> (The foregoing was undertaken as an exercise from working through "Deploying 
> Rails" by Anthony Burns & Tom Copeland.)
> 
> Gallagher
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] permission denied when executing "sftp upload..." in cap deploy

2013-09-04 Thread Donovan Bray
If you want to FIX the problem both Lee and I have pointed you in the right 
direction based on the information you've given. 

If you want to LEARN Linux then nothing beats doing an LFS installation. 

http://www.linuxfromscratch.org/lfs/

I did it many years ago and it answered a ton of 'Why? Questions' that I 
benefit from even today.

It will give you names for patterns you've seen but never knew and give you the 
reasons why it is that way. 
It will give you a new appreciation for package management, and the hard work 
packagers contribute. 
It will give you a new appreciation for the excellent mature distributions we 
have available to us now. 
I guarantee you won't be afraid to compile apps from source anymore. 

If you want to learn more after doing LFS, install the following distributions 
in different vms and get used to them and their differences. 

Try setting up your application on each one of them. 

net-bsd or free-bsd
Redhat or fedora
Debian or Ubuntu 
Gentoo

Gentoo is a lot of fun but I don't use it in production nor would I use LFS, 
but as learning tools they are excellent. 

Good luck. 

On Sep 4, 2013, at 12:40 AM, Chou Chiang  wrote:

> Hi All,
> 
> I meet a permission problem in the process of deploying jekyll to my 
> production server(Ubuntu 12.04 LTS). Here's what I'm getting in response to 
> "cap deploy".
> 
>>   * 2013-09-04 06:58:23 executing `deploy't
>>   * 2013-09-04 06:58:23 executing `deploy:update'
>> triggering before callbacks for `deploy:update'
>>   * 2013-09-04 06:58:23 executing `deploy:update_jekyll'
>>  ** transaction: start
>>   * 2013-09-04 06:58:23 executing `deploy:update_code'
>>   * getting (via checkout) revision  to /home/lee/blog/20130904065823
>> executing locally: cp -R _site /home/lee/blog/20130904065823
>> command finished in 2ms
>>   * Compressing /home/lee/blog/20130904065823 to 
>> /home/lee/blog/20130904065823.tar.gz
>> executing locally: tar czf 20130904065823.tar.gz 20130904065823
>> command finished in 3ms
>> servers: ["zhby.com"]
>> Password:
>>  ** sftp upload /home/lee/blog/20130904065823.tar.gz -> 
>> /tmp/20130904065823.tar.gz
>> [zhby.com] /tmp/20130904065823.tar.gz
>> *** upload via sftp failed on zh***by.com: Net::SFTP::StatusException 
>> (Net::SFTP::StatusException open /tmp/20130904065823.tar.gz (3, "permission 
>> denied"))
>> *** [deploy:update_code] rolling back
>>   * executing "rm -rf /home/lee/apps/blog/releases/20130904065823; true"
>> servers: ["zhby.com"]
>> [zhby.com] executing command
>> command finished in 4ms
>> upload via sftp failed on zhby.com: Net::SFTP::StatusException 
>> (Net::SFTP::StatusException open /tmp/20130904065823.tar.gz (3, "permission 
>> denied"))
> 
> 
> It seems that this is because sftp have no permission to access /tmp 
> directory.And This can be solved by chmod -R 777 tmp/ . However, I don't 
> think it's a good idea for every to have full control of /tmp directory.
> So what can I do to solve this problem?
> 
> BTW, I am particularly interested in understanding the permission of Linux. 
> For example, why 'cp' have no permission to access the /tmp directory after I 
> change the owner of /tmp to current user?
> I deeply appreciate the people who can teach me something about that.
> 
> Thank you very much!
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] permission denied when executing "sftp upload..." in cap deploy

2013-09-04 Thread Donovan Bray
> chmod -R 777 tmp/ 

tmp/ != /tmp

Be careful using relative directory names. 

It's unlikely that if /tmp is not world writeable you'll have the necessary 
privs to change it unless you are the one that changed its permissions to begin 
with; which would have been a mistake. 

You shouldn't mess with ownership of /tmp itself. 

http://www.davekb.com/browse_computer_tips:linux_what_permissions_should_the_tip_folder_have_set:txt

I suspect you have damaged permissions of the /tmp directory and/or possibly 
chrooted or otherwise misconfigured your sftp configuration. You can try 
setting the strategy to use :via => :scp and see if you get different results. 

I'm unfamiliar with setting the default copy method with other strategies 
because I've never had the occasion to use a copy strategy but I know it can be 
overridden. 


On Sep 4, 2013, at 12:40 AM, Chou Chiang  wrote:

> Hi All,
> 
> I meet a permission problem in the process of deploying jekyll to my 
> production server(Ubuntu 12.04 LTS). Here's what I'm getting in response to 
> "cap deploy".
> 
>>   * 2013-09-04 06:58:23 executing `deploy'
>>   * 2013-09-04 06:58:23 executing `deploy:update'
>> triggering before callbacks for `deploy:update'
>>   * 2013-09-04 06:58:23 executing `deploy:update_jekyll'
>>  ** transaction: start
>>   * 2013-09-04 06:58:23 executing `deploy:update_code'
>>   * getting (via checkout) revision  to /home/lee/blog/20130904065823
>> executing locally: cp -R _site /home/lee/blog/20130904065823
>> command finished in 2ms
>>   * Compressing /home/lee/blog/20130904065823 to 
>> /home/lee/blog/20130904065823.tar.gz
>> executing locally: tar czf 20130904065823.tar.gz 20130904065823
>> command finished in 3ms
>> servers: ["zhby.com"]
>> Password:
>>  ** sftp upload /home/lee/blog/20130904065823.tar.gz -> 
>> /tmp/20130904065823.tar.gz
>> [zhby.com] /tmp/20130904065823.tar.gz
>> *** upload via sftp failed on zh***by.com: Net::SFTP::StatusException 
>> (Net::SFTP::StatusException open /tmp/20130904065823.tar.gz (3, "permission 
>> denied"))
>> *** [deploy:update_code] rolling back
>>   * executing "rm -rf /home/lee/apps/blog/releases/20130904065823; true"
>> servers: ["zhby.com"]
>> [zhby.com] executing command
>> command finished in 4ms
>> upload via sftp failed on zhby.com: Net::SFTP::StatusException 
>> (Net::SFTP::StatusException open /tmp/20130904065823.tar.gz (3, "permission 
>> denied"))
> 
> 
> It seems that this is because sftp have no permission to access /tmp 
> directory.And This can be solved by chmod -R 777 tmp/ . However, I don't 
> think it's a good idea for every to have full control of /tmp directory.
> So what can I do to solve this problem?
> 
> BTW, I am particularly interested in understanding the permission of Linux. 
> For example, why 'cp' have no permission to access the /tmp directory after I 
> change the owner of /tmp to current user?
> I deeply appreciate the people who can teach me something about that.
> 
> Thank you very much!
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] deploy:cleanup with multiple roles

2013-08-20 Thread Donovan Bray
Try using an ENV variable other than 'hosts' like 'myhosts' I think cap may use 
the hosts ENV variable under the hood. Name the ruby variable myhosts as well 
just for good measure. 

Now the call to ls -xt. Is in a capture it only runs against one host by 
design. If it finds stuff to delete then it will do the deletes across the 
servers. What is your keep_releases value?

Why is the path it's checking literally /path/to/releases?

Are you obfuscating the path in your paste?  Or is that really the output?

If that's really the output and your deploy_to isn't /path/to you have some 
sorting out to do in your recipes. 

Don't even look at the following link until you can run the canned 
deploy:cleanup. 

I've used this method in the past that was useful when the release directories 
were out of sync, the downside is it's slow and the more hosts you have the 
slower it is. I ended up removing it once my directories were back in sync.

 http://blog.perplexedlabs.com/2010/09/08/improved-deploycleanup-for-capistrano/

On Aug 17, 2013, at 5:24 PM, "C. Benson Manica"  wrote:

> Hm, I would swear up and down that I tried exactly that several times and got 
> odd error messages. Trying it now, however, still doesn't appear to do what I 
> need - setting the variable to "server1,server2" yields the following output
> 
> triggering load callbacks
>   * 2013-08-17 17:22:59 executing `deploy:cleanup'
>   * executing "ls -xt /path/to/releases"
> servers: ["server1"]
> [server1] executing command
> command finished in 512ms
> *** no old releases to clean up
> 
> It doesn't try to remove old releases on server2.
> 
> On Thursday, August 15, 2013 8:37:31 PM UTC-7, dbray wrote:
>> 
>> Ahh the problem lies not in cap but your definition
>> 
>> hosts=ENV['hosts'].split(',')
>> hosts.each do |instance|
>>   role :web, *hosts
>>   role :app, *hosts
>>   role :db, *hosts
>> end
>> 
>> If your hosts is really semi colon delimited the host.each loop is 
>> unnecessary the splat operator takes care of it. 
>> 
>> hosts may also be a reserved name in capistrano
>> 
>> If hosts is not reserved, and you've really fed the environment variable a 
>> comma delimited list then
>> 
>> hosts=ENV['hosts'].split(',').map(&:strip)
>> role :web, *hosts
>> role :app, *hosts
>> role :db, *hosts
>> 
>> (I would strip the results for safety.)
>> 
>> Should be enough, or switch it around to the server helper and don't even 
>> bother with an intermediate variable. 
>> 
>> ENV['hosts'].split(',').map(&:strip).each do |instance|
>>   server instance, :web, :app, :db
>> end
>> 
>> On Aug 14, 2013, at 10:47 PM, "C. Benson Manica"  wrote
>> 
>>> Why does 
>>> 
>>> https://gist.github.com/cbmanica/62385
>>> 
>>> only execute deploy:cleanup on one of the hosts specified? And why hasn't 
>>> anyone on the entire internet documented how to accomplish such a seemingly 
>>> universal task?
>>> -- 
>>> -- 
>>> * You received this message because you are subscribed to the Google Groups 
>>> "Capistran group.
>>> * To post to this group, send email to capis...@googlegroups.com
>>> * To unsubscribe from this group, send email to 
>>> capistrano+...@googlegroups.com For more options, visit this group at 
>>> http://groups.google.com/group/capistrano?hl=en
>>> --- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Capistrano" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to capistrano+...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] deploy:cleanup with multiple roles

2013-08-15 Thread Donovan Bray
Ahh the problem lies not in cap but your definition

hosts=ENV['hosts'].split(',')
hosts.each do |instance|
  role :web, *hosts
  role :app, *hosts
  role :db, *hosts
end

If your hosts is really semi colon delimited the host.each loop is unnecessary 
the splat operator takes care of it. 

hosts may also be a reserved name in capistrano

If hosts is not reserved, and you've really fed the environment variable a 
comma delimited list then

hosts=ENV['hosts'].split(',').map(&:strip)
role :web, *hosts
role :app, *hosts
role :db, *hosts

(I would strip the results for safety.)

Should be enough, or switch it around to the server helper and don't even 
bother with an intermediate variable. 

ENV['hosts'].split(',').map(&:strip).each do |instance|
  server instance, :web, :app, :db
end

On Aug 14, 2013, at 10:47 PM, "C. Benson Manica"  wrote

> Why does 
> 
> https://gist.github.com/cbmanica/62385
> 
> only execute deploy:cleanup on one of the hosts specified? And why hasn't 
> anyone on the entire internet documented how to accomplish such a seemingly 
> universal task?
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistran group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] deploy:cleanup with multiple roles

2013-08-15 Thread Donovan Bray
https://github.com/capistrano/capistrano/blob/v2.15.4/lib/capistrano/recipes/deploy.rb

  desc <<-DESC
Clean up old releases. By default, the last 5 releases are kept on each \
server (though you can change this with the keep_releases variable). All \
other deployed revisions are removed from the servers. By default, this \
will use sudo to clean up the old releases, but if sudo is not available \
for your environment, set the :use_sudo variable to false instead.
DESC
  task :cleanup, :except => { :no_release => true } do
count = fetch(:keep_releases, 5).to_i
try_sudo "ls -1dt #{releases_path}/* | tail -n +#{count + 1} | #{try_sudo} 
xargs rm -rf"
  end

The default deploy:cleanup task does go across all roles. It correctly excludes 
servers marked no_release. 

Did you or a plugin or include override this task?

Are you on an old release of capistrano?

I don't see a problem here. 

On Aug 14, 2013, at 10:47 PM, "C. Benson Manica"  wrote:

> Why does 
> 
> https://gist.github.com/cbmanica/6238555
> 
> only execute deploy:cleanup on one of the hosts specified? And why hasn't 
> anyone on the entire internet documented how to accomplish such a seemingly 
> universal task?
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [capistrano] Capistrano failing on pkill-related tasks?

2013-08-12 Thread Donovan Bray
sudo "pkill -f [f]red"

Will also work. Because pkill is good about not killing its own pid, but as 
pointed out doesn't prevent killing the parent shell running pkill where "fred" 
will also be found. 

The above uses a regex of looking for an "f" followed by "red", and since the 
shell now shows "[f]red" it does not match and won't be killed. 

On Aug 7, 2013, at 1:16 PM, Francis Fish  wrote:

> Hi guys
> 
> Just in case someone reads this again ... cap is running
> 
> sh -c 'pkill -f fred'
> 
> which means the shell will be killed because it matches fred, so it always 
> returns false. 
> 
> See, for example:
> 
> $ pgrep -f nunu
> $ sh -c 'pgrep -f nunu'
> 16431
> 
> Which finds the sh with those args
> 
> sh -c 'exec $(pkill nunu || true)'
> 
> Will do what you want because the shell is replaced by the exec command.
> 
> Not sure if this is an issue for cap 3.
> 
> On Sunday, 18 April 2010 10:13:05 UTC+1, Lee Hambley wrote:
>> 
>> Chris,
>> 
>> That's triggered by the posix return code of, in this case pkill or your 
>> conditional statement. I suggest adding something like a `&& true`; so it 
>> alwasy returns a `sucess` code.
>> 
>> - Lee
>> 
>> On 17 April 2010 10:52, Christopher Opena  wrote:
>>> Hello all, I'm doing some experimentation on using pkill inside of 
>>> Capistrano to kill multiple processes at once.  I'm performing the pkill 
>>> inside of a bash (sudo "if [cond]; then pkill #{process} fi") conditional.  
>>> For troubleshooting's sake, I'm making sure the [cond] prints out the 
>>> output.  No problems there, the if [cond] finds and prints out the process 
>>> and pkill actually does kill the process when it's found, but then 
>>> Capistrano exits out with a:
>>> 
>>> command finished
>>> command "pkill #{process}" failed on #{server_name}
>>> 
>>> Has anyone experienced a problem like this before?
>>> 
>>> I even tried pulling the sudo bash command out of Capistrano and into a 
>>> bash script and then having Capistrano run the script (sudo 
>>> "/path/to/script"), and it runs it successfully and I see the task getting 
>>> killed, but the Cap exists with:
>>> 
>>> command finished
>>> command "sudo /path/to/script" failed on #{server_name}
>>> 
>>> Anyone have any ideas?  This one is really strange, and I'm a bit stumped.  
>>> Although it's successful in the end, it makes it hard to place the task in 
>>> the middle of a long string of tasks because it exits out and doesn't 
>>> continue :/
>>> 
>>> Thanks in advance,
>>> -Chris.
>>> -- 
>>> * You received this message because you are subscribed to the Google Groups 
>>> "Capistrano" group.
>>> * To post to this group, send email to capis...@googlegroups.com
>>> * To unsubscribe from this group, send email to 
>>> capistrano+...@googlegroups.com For more options, visit this group at 
>>> http://groups.google.com/group/capistrano?hl=en
>> 
>> -- 
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to capis...@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/capistrano?hl=en
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Get Role name within a task

2013-08-06 Thread Donovan Bray
I can only make the strongest recommendation to Lee to remove the 
recommendation to use the Capfile in this way. 

Ultimately it's up to each implementer to determine how they want this done. 

I for one don't like and wouldn't put implementation in the Capfile. 

The Capfile should only contain the necessary minimum glue to make capistrano 
work. 

Implementation of your recipe structure should start in config/deploy.rb as it 
always has. Sticking stuff in the Capfile in my mind violates the principle of 
least surprise. 

On Aug 6, 2013, at 1:50 AM, "Kir S."  wrote:

> I had the same idea, but then I found that default Capfile 
> (https://github.com/capistrano/capistrano/blob/v3/lib/capistrano/templates/Capfile)
>  contains tasks.
> 
> On Tuesday, August 6, 2013 3:11:27 AM UTC+4, dbray wrote:
>> 
>> The Capfile is an odd choice to put tasks of any description IMO. Capfile 
>> should have only the things that make the cap cli work the way you want. It 
>> should be seldom looked at and modified even less. 
>> 
>> Otherwise tasks should be in config/deploy.rb or a require inside thereof. 
>> 
>> Someone new to your cap scripts should be able to start at config/deploy.rb 
>> to get an idea of what it's about and not get surprised by a bunch of code 
>> that got put in the Capfile. 
>> 
>> 
>> On Aug 5, 2013, at 3:36 PM, Jonathan Rochkind  wrote: 
>> 
>> > Thanks! First thing I'm confused about is the right place to put 
>> > stage-specific logic now: 
>> > 
>> >  
>> > 5. Capistrano 3.x has changed structure of recepies. Before that you put 
>> > stage-specific code to config/deploy/stage_name.rb, but now 
>> > config/deploy.rb should contain only global options for all stages. Tasks 
>> > like restarting Unicorns and preparing configs should now be placed in 
>> > Capfile. 
>> > 
>> > Now you need to refactor your old deploy.rb (also Capfile, but in most of 
>> > cases developers didn't change it in Capistrano 2.x). Move parameters 
>> > (like set :deploy_to, "/home/deploy/#{application}" or set :keep_releases, 
>> > 4) to config/deploy.rb and tasks to Capfile. 
>> >  
>> > 
>> > Okay, so if I have tasks that run only under 'staging', or varible 
>> > definitions that only apply to 'staging', I do NOT any longer put them in 
>> > config/deploy/staging.rb? 
>> > 
>> > Instead, I put them in ./Capfile?  I don't understand how I can define 
>> > settings (definition of tasks or variable) that will only apply to certain 
>> > stages in the Capfile.  An example might be helpful here? The most basic 
>> > example, that everyone will need, is how to define your stage-specific 
>> > hostnames. 
>> > 
>> > Jonathan 
>> > 
>> > On 8/5/13 6:24 PM, Kir S. wrote: 
>> >> Sure! 
>> >> v.3 
>> >> announcement: 
>> >> http://www.capistranorb.com/2013/06/01/release-announcement.html 
>> >> upgrading guide: http://www.capistranorb.com/documentation/upgrading/ 
>> >> 
>> >> On Wednesday, July 10, 2013 1:13:39 AM UTC+4, Jonathan Rochkind wrote: 
>> >> 
>> >>Nice to see this is close! Is there a document on differences 
>> >>between v2 
>> >>and v3, a guide to what you're going to have to deal with in trying to 
>> >>upgrade? 
>> >> 
>> >>On 7/9/13 4:33 PM, Lee Hambley wrote: 
>> >> > Not possible with v2, see the release announcement at 
>> >> > http://capistranorb.com - v3 will be the main release within a 
>> >>few days, 
>> >> > you can already use it. 
>> >> > 
>> >> > On Tuesday, July 9, 2013, Carlos Pe�as wrote: 
>> >> > 
>> >> > There's a lot of questions arround this topic and I feel that 
>> >> > there's no direct solution. 
>> >> > 
>> >> > Is there a way to get the current role name for a task to use 
>> >>it in 
>> >> > a variable? 
>> >> > 
>> >> > This is what I'm trying to acomplish 
>> >> > 
>> >> > task upload_different_file do 
>> >> > upload 
>> >> > 
>> >>"server_cfg/#{stage}/*#{computed_role}*/my_custom_and_needed_file" 
>> >> > "/tmp" 
>> >> > run "echo *#{computed_role}* >> 
>> >>/tmp/fancy_roles_enumeration" 
>> >> > ... and the like ... 
>> >> > end 
>> >> > 
>> >> > That's it. The role name should be arbitrary because this is 
>> >>planed 
>> >> > to upload several files to a server, based on its role declared 
>> >> > 
>> >> > I know that if there's a server with two roles calling twice 
>> >>to that 
>> >> > kind of task, it will lead to file collision, but I will 
>> >>handle that 
>> >> > later. 
>> >> > 
>> >> > Is this posibble? 
>> >> > 
>> >> > Thanks 
>> >> > 
>> >> > . 
>> >> > 
>> >> > -- 
>> >> > -- 
>> >> > * You received this message because you are subscribed to the 
>> >>Google 
>> >> > Groups "Capistrano" group. 
>> >> > * To post to this group, send email t

Re: [capistrano] Get Role name within a task

2013-08-05 Thread Donovan Bray
I've handled this differently in the past.

task upload_different_file do
  upload_different_file_for_app
  upload_different_file_for_worker
end

task upload_different_file_for_app, :roles => [:app] do
  ...
end

task upload_different_file_for_worker, :roles => [:worker] do
  ...
end

you still only have to have one task you call to get the job done.

the sub-tasks do the job of applying the files to the right roles, where
you can make all the assumptions about which role your dealing with INSIDE
the sub-task.


On Tue, Jul 9, 2013 at 1:27 PM, Carlos Peñas  wrote:

> There's a lot of questions arround this topic and I feel that there's no
> direct solution.
>
> Is there a way to get the current role name for a task to use it in a
> variable?
>
> This is what I'm trying to acomplish
>
> task upload_different_file do
>upload "server_cfg/#{stage}/*#{computed_role}*/my_custom_and_needed_file"
> "/tmp"
>run "echo *#{computed_role}* >> /tmp/fancy_roles_enumeration"
>... and the like ...
> end
>
> That's it. The role name should be arbitrary because this is planed to
> upload several files to a server, based on its role declared
>
> I know that if there's a server with two roles calling twice to that kind
> of task, it will lead to file collision, but I will handle that later.
>
> Is this posibble?
>
> Thanks
>
> .
>
> --
> --
> * You received this message because you are subscribed to the Google
> Groups "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to
> capistrano+unsubscr...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/capistrano?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Get Role name within a task

2013-08-05 Thread Donovan Bray
The Capfile is an odd choice to put tasks of any description IMO. Capfile 
should have only the things that make the cap cli work the way you want. It 
should be seldom looked at and modified even less. 

Otherwise tasks should be in config/deploy.rb or a require inside thereof. 

Someone new to your cap scripts should be able to start at config/deploy.rb to 
get an idea of what it's about and not get surprised by a bunch of code that 
got put in the Capfile. 


On Aug 5, 2013, at 3:36 PM, Jonathan Rochkind  wrote:

> Thanks! First thing I'm confused about is the right place to put 
> stage-specific logic now:
> 
> 
> 5. Capistrano 3.x has changed structure of recepies. Before that you put 
> stage-specific code to config/deploy/stage_name.rb, but now config/deploy.rb 
> should contain only global options for all stages. Tasks like restarting 
> Unicorns and preparing configs should now be placed in Capfile.
> 
> Now you need to refactor your old deploy.rb (also Capfile, but in most of 
> cases developers didn't change it in Capistrano 2.x). Move parameters (like 
> set :deploy_to, "/home/deploy/#{application}" or set :keep_releases, 4) to 
> config/deploy.rb and tasks to Capfile.
> 
> 
> Okay, so if I have tasks that run only under 'staging', or varible 
> definitions that only apply to 'staging', I do NOT any longer put them in 
> config/deploy/staging.rb?
> 
> Instead, I put them in ./Capfile?  I don't understand how I can define 
> settings (definition of tasks or variable) that will only apply to certain 
> stages in the Capfile.  An example might be helpful here? The most basic 
> example, that everyone will need, is how to define your stage-specific 
> hostnames.
> 
> Jonathan
> 
> On 8/5/13 6:24 PM, Kir S. wrote:
>> Sure!
>> v.3
>> announcement: 
>> http://www.capistranorb.com/2013/06/01/release-announcement.html
>> upgrading guide: http://www.capistranorb.com/documentation/upgrading/
>> 
>> On Wednesday, July 10, 2013 1:13:39 AM UTC+4, Jonathan Rochkind wrote:
>> 
>>Nice to see this is close! Is there a document on differences
>>between v2
>>and v3, a guide to what you're going to have to deal with in trying to
>>upgrade?
>> 
>>On 7/9/13 4:33 PM, Lee Hambley wrote:
>> > Not possible with v2, see the release announcement at
>> > http://capistranorb.com - v3 will be the main release within a
>>few days,
>> > you can already use it.
>> >
>> > On Tuesday, July 9, 2013, Carlos Pe�as wrote:
>> >
>> > There's a lot of questions arround this topic and I feel that
>> > there's no direct solution.
>> >
>> > Is there a way to get the current role name for a task to use
>>it in
>> > a variable?
>> >
>> > This is what I'm trying to acomplish
>> >
>> > task upload_different_file do
>> > upload
>> >
>>"server_cfg/#{stage}/*#{computed_role}*/my_custom_and_needed_file"
>> > "/tmp"
>> > run "echo *#{computed_role}* >>
>>/tmp/fancy_roles_enumeration"
>> > ... and the like ...
>> > end
>> >
>> > That's it. The role name should be arbitrary because this is
>>planed
>> > to upload several files to a server, based on its role declared
>> >
>> > I know that if there's a server with two roles calling twice
>>to that
>> > kind of task, it will lead to file collision, but I will
>>handle that
>> > later.
>> >
>> > Is this posibble?
>> >
>> > Thanks
>> >
>> > .
>> >
>> > --
>> > --
>> > * You received this message because you are subscribed to the
>>Google
>> > Groups "Capistrano" group.
>> > * To post to this group, send email to capis...@googlegroups.com
>> > * To unsubscribe from this group, send email to
>> > capistrano+...@googlegroups.com For more options, visit this
>> > group at http://groups.google.com/group/capistrano?hl=en
>>
>> > ---
>> > You received this message because you are subscribed to the
>>Google
>> > Groups "Capistrano" group.
>> > To unsubscribe from this group and stop receiving emails from
>>it,
>> > send an email to capistrano+...@googlegroups.com.
>> > For more options, visit
>>https://groups.google.com/groups/opt_out
>>.
>> >
>> >
>> >
>> >
>> > --
>> > Lee Hambley
>> > --
>> > http://lee.hambley.name/
>> > +49 (0) 170 298 5667
>> >
>> > --
>> > --
>> > * You received this message because you are subscribed to the Google
>> > Groups "Capistrano" group.
>> > * To post to this group, send email to capis...@googlegroups.com
>> > * To unsubscribe from this group, send email to
>> > capistrano+...@googlegroups.com For more options, v

Re: [capistrano] Capistrano deployment behaviour

2013-07-27 Thread Donovan Bray
#{release_path} should probably be #{latest_release}

On Jul 26, 2013, at 6:37 PM, João Pereira  wrote:

> have this deploy.rb
> after 'deploy:update_code', 'deploy:symlink_db', 'deploy:symlink_email'
> after 'deploy:setup', 'setup:create_db_configuration', 
> 'setup:create_email_configuration'
> 
> 
> namespace :deploy do
>   desc "Symlinks the email.yml"
>   task :symlink_email, :roles => :app do
> puts "##Sybolic Link the email.yml"
> run "ln -nfs #{deploy_to}/shared/config/email.yml 
> #{release_path}/config/email.yml"
>   end
> 
> desc "Symlinks the database.yml"
>   task :symlink_db, :roles => :app do
> puts "##Sybolic Link the database.yml"
> run "ln -nfs #{deploy_to}/shared/config/database.yml 
> #{release_path}/config/database.yml"
>   end
> But when I deploy, after the deploy:update_code it starts with
> 
> 2013-07-27 03:30:30 executing `deploy:assets:symlink'
> then
> 
> 2013-07-27 03:30:32 executing `deploy:assets:precompile'
> And when execution
> 
> executing "cd -- /home/ubuntu/deployments/saleshub/releases/20130727013023 && 
> RAILS_ENV=production RAILS_GROUPS=assets rake assets:precompile"
> It fails, because the symbolic links were not created yet. How do I make sure 
> the my tasks to create the symlinks before compiling the assets?
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Custom capistrano task in multistage

2013-07-12 Thread Donovan Bray
if fetch(:foo_var,nil) 
  #something that needs a foo_var
end

This checks and returns the cap foo_var variable if not set returns nil, and it 
doesn't change or define the variable. 

On Jul 11, 2013, at 9:22 AM, Simone Fumagalli  
wrote:

> Hello. I'm new to Capistrano 
> 
> I'm trying to write my first post task but I've a problem checking if a var 
> is defined or not.
> I've a multistage setup. For the staging environment the variable foo_var is 
> defined for the prod environment is not.
> 
> Here my task https://gist.github.com/hpatoio/5976877
> 
> Environment info
> 
> - rvm 1.21.5 (stable)
> - ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]
> - Capistrano v2.15.4
> 
> Ideas ?
> 
> Thanks
> 
> --
> Simone
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Re: Trapping Interrupts or otherwise ensuring an action on failure

2013-05-31 Thread Donovan Bray
Done in the write_deploy_lock function you may be able to leverage ruby's 
at_exit handler. 

http://trevoke.net/blog/2012/01/06/ruby-what-is-at_exit-and-how-to-write-tests-for-it/

On May 30, 2013, at 2:51 PM, Benjamin Fleischer  wrote:

> I also asked on IRC and torrancew led me to try this
> 
>  before 'deploy:rollback',   'deploy:unlock'
> 
>  def write_deploy_lock(deploy_lock)
>put deploy_lock.to_yaml, deploy_lockfile, :mode => 0777
> +  # Ensure the lockfile is remove on Interrupt
> +  trap("INT") {
> +STDERR.puts 'Got shutdown signal, removing lockfile'
> +remove_deploy_lock
> +  }
>  end
> 
> I'm not sure how to test that, but it's what I have for now. I think my other 
> alternative would be to alias the capistrano handle_errors method to add my 
> functionality
> 
> If I add a bad github url I get
> ERROR: Repository not found.
> fatal: The remote end hung up unexpectedly
> *** [deploy:update_code] rolling back
> Command git ls-remote g...@github.com:...git  master returned status code pid 
> 76578 exit 128
> 
> but it didn't run the unlock task
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Weird error executing SSH command via Capistrano 2.15.4.

2013-05-25 Thread Donovan Bray
Dan,

I still have this line in my Gemfile for my older Ree 1.8.7 application

Add it to yours and see if it helps.

  gem 'net-ssh', '2.4.0' #https://github.com/net-ssh/net-ssh/issues/45
Known issue with 2.5.1




On Sat, May 25, 2013 at 1:06 AM, Lee Hambley  wrote:

> Dan,
>
> That looks like the same "we think it's Net::SSH" issue - if you can find
> a way to crank the reporting level on Net::SSH to "Debug" you see a lot
> more information (down to bytes on the stream) and might be able to better
> diagnose it.
>
> FWIW, 1.8.7 is now officially unsupported by Ruby, and as such unsupported
> by us, although the README still says otherwise.
>
> - Lee
>
> Lee Hambley
> --
> http://lee.hambley.name/
> +49 (0) 170 298 5667
>
>
> On 25 May 2013 05:01, Dan Sullivan  wrote:
>
>> Hi,
>>
>> I am having a weird error during a deployment using capistrano 2.x.I
>> am unsure whether or not this is directly related to net-ssh (as suggested
>> below), or by Capistrano itself (the occurs when executing a Capistrano
>> task).  First and foremost, I want to say that I am fairly confident that
>> this was working before; I'm guessing that this error has something to do
>> with a newer version of net-ssh and or Capistrano, however this has yet to
>> be proven.
>>
>> The full stack trace of my error is here:
>>
>> http://pastie.org/7956002
>>
>> What is particularly unusual to me is that if I run a single command in
>> the task, the command (i.e. create a directory), the task runs fine.  As
>> soon as I run a second command in the same task, the deployment script
>> bombs out with the stack trace above, even if it is the exact same command
>> run twice in a row in the same task (as defined in the pastie below).
>>
>> I've stripped down my deploy.rb to include a very minimal amount of code
>> to illustrate the problem.  The past of this code is here.
>>
>> http://pastie.org/7955994
>>
>> I am running ruby 1.8.7 (2012-10-12 patchlevel 371) [x86_64-linux] and
>> Capistrano v2.15.4.
>>
>> In addition to this, I am running ruby RVM ruby-1.8.7-p371.  Finally, my
>> bundle list is below:
>>
>> I would really appreciate any insight that somebody could provide for me
>> in resolving this issue.  Thank-you so much for your time and attention in
>> helping me look at this problem.
>>
>> Dan Sullivan
>>
>> --[dps@neve]-[/tmp/asap/asap]--
>> > bundle list
>> Gems included by the bundle:
>>   * actionmailer (2.3.14)
>>   * actionpack (2.3.14)
>>   * activerecord (2.3.14)
>>   * activeresource (2.3.14)
>>   * activesupport (2.3.14)
>>   * builder (3.2.0)
>>   * bundler (1.3.5)
>>   * capistrano (2.15.4)
>>   * configatron (2.6.3)
>>   * declarative_authorization (0.4.1)
>>   * fastercsv (1.5.3)
>>   * haml (3.0.4)
>>   * highline (1.6.19)
>>   * hoptoad_notifier (2.4.7)
>>   * liquid (2.0.0)
>>   * memcache-client (1.8.3)
>>   * mysql (2.9.1)
>>   * net-scp (1.1.1)
>>   * net-sftp (2.1.2)
>>   * net-ssh (2.6.7)
>>   * net-ssh-gateway (1.2.0)
>>   * newrelic_rpm (2.13.4)
>>   * nokogiri (1.4.1)
>>   * paperclip (2.3.1.1)
>>   * pdfkit (0.5.2)
>>   * prawn (0.8.4)
>>   * prawn-core (0.8.4)
>>   * prawn-layout (0.8.4)
>>   * prawn-security (0.8.4)
>>   * preferences (0.4.2)
>>   * rack (1.1.6)
>>   * rails (2.3.14)
>>   * rake (0.8.7)
>>   * ruby_parser (2.0.6)
>>   * sanitize (1.2.1)
>>   * searchlogic (2.5.14)
>>   * sexp_processor (3.2.0)
>>   * slim_scrooge (1.0.11)
>>   * uuidtools (2.1.1)
>>   * version_bumper (0.3.0)
>>   * will_paginate (2.3.12)
>>   * yamler (0.1.0)
>> --[dps@neve]-[/tmp/asap/asap]--
>> >
>>
>>
>>
>>
>>
>>
>>
>>  --
>> --
>> * You received this message because you are subscribed to the Google
>> Groups "Capistrano" group.
>> * To post to this group, send email to capistrano@googlegroups.com
>> * To unsubscribe from this group, send email to
>> capistrano+unsubscr...@googlegroups.com For more options, visit this
>> group at http://groups.google.com/group/capistrano?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Capistrano" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to capistrano+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> --
> * You received this message because you are subscribed to the Google
> Groups "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to
> capistrano+unsubscr...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/capistrano?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
* You received this message because you are subscribed to the Google Gr

Re: [capistrano] Cap Deploy Failing on chmod releases

2013-05-22 Thread Donovan Bray
Snippet of the relevant log and paste the task that calls the chmod

On May 22, 2013, at 9:54 AM, Mike Ferraco  wrote:

> I am attempting to deploy a RoR application from my computer to my remote 
> server with capistrano and rvm.  I have set up the folder structure on the 
> server and also allowed write privileges on all of the folders,
> 
> I am using cap v2.15.4, ruby 1.9.3p392, and rvm 1.20.3.
> 
> When attempting to deploy the failure occurs when capistrano tryies to chmod 
> a specific release (it looks like it is the release it is trying to create) 
> and it fails saying "no such file or directory".  I have run cap deploy:check 
> there are no missing dependencies.  Any help with this would be greatly 
> appreciated.  Thanks!
> 
> Mike
> 
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Re: After successful deployment app not running on production server (RoR/Capistrano/Github)

2013-05-14 Thread Donovan Bray
Ensure that there is only one nginx config since you are using port 80 and no 
server_names defined. Ie remove the default conf in sites-enabled

On May 14, 2013, at 4:06 PM, Hassan Schroeder  
wrote:

> On Tue, May 14, 2013 at 3:54 PM, Makru  wrote:
>> Post.find (:all)
>> answers:
>> Post Load (1.2ms) 
>> =>nil
>> Is working under development and showing all entries. I assume under
>> production the table is there, but no entry.
>> app.get 'posts/new'
>> answers:
>> =>200
>> Same answer as under development.
>> But the good thing, i know now something about rails console :-)
> 
> OK, so your app apparently is basically working. But (restating) if
> you try to access /posts/new from a browser you get a 404, right?
> 
> What happens if you access the unicorn instance directly, from the
> server command line?
> 
> If the above works, then the problem is somewhere between nginx
> and unicorn; you should find your nginx log(s) and see what happens
> at that point.
> 
> I would open up 3-4 windows side-by-side and tail -f the nginx
> access, error, and unicorn log(s) -- don't remember if it has both
> access and error logs -- and watch in real time.
> 
> -- 
> Hassan Schroeder  hassan.schroe...@gmail.com
> http://about.me/hassanschroeder
> twitter: @hassan
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Re: After successful deployment app not running on production server (RoR/Capistrano/Github)

2013-05-14 Thread Donovan Bray
Looks like your socket paths match up

listen "/tmp/unicorn.blog.sock", :backlog => 64
listen 8080, :tcp_nopush => true

You don't need the 8080 listener though it doesn't hurt anything. 

Do you have rvm installed on the server? If you do you have to sort that out 
first. You may be starting it without rvm loaded and going to the system ruby. 

How do you start unicorn?

On May 14, 2013, at 2:05 PM, Makru  wrote:

> Hello,
> 
> thanks for the answers. Learned a lot through the discussion :-)
> 
> Here is the unicorn.rb : https://gist.github.com/Makru/5579322 
> The only pointing i can see is : pid APP_PATH + "/tmp/pids/unicorn.pid"
> 
> The small test application is running on the Windows development PC.
> 
> I am able to open a Raisl Console in the current folder on the server.
> 
> The strange thing is, the console opens with :
> "Loading production enviroment (Rails 3.2.13)
> 1.9.1 :001> "
> I have ruby 1.9.3p392 installed on the server and development pc. ruby -v is 
> showing that. Should it not the same version in the rails console ? The rails 
> version is like installed.
> 
> production.log looks ok, no error
> unicorn.blog.stderr.log shows no error
> I can not find a nginx log.
> 
> This is the deploy.rb : https://gist.github.com/Makru/5579470 Perhaps this 
> helps...
> 
> Regards
> Mathias
> 
> 
> 
> 
> 
> Am Dienstag, 14. Mai 2013 17:49:22 UTC+2 schrieb dbray:
>> 
>> Does the app work in development mode locally?
>> 
>> On May 14, 2013, at 6:41 AM, Makru  wrote:
>> 
>>> Hello again,
>>> 
>>> nginxis running and showing the rails welcome page. Only the application 
>>> and the link at the Rails welcome page called 
>>> About your application’s environment
>>> 
>>> are not reachable and showing only:
>>> 
>>> 404 Not Found
>>> nginx/1.4.0
>>> 
>>> Thats why i am not sure, where the problem is
>>> 
>>> Regards
>>> 
>>> Mathias
>>> 
>>> 
>>> 
>>> 
>>> Am Dienstag, 14. Mai 2013 15:28:15 UTC+2 schrieb Lee Hambley:
 
 Sorry Mathias,
 
 This is the wrong place to get nginx support, I'd try #nginx on Freenode's 
 IRC network.
 
 (it's a time thing, perhaps someone else on the list can help you)
 
 Lee Hambley
 --
 http://lee.hambley.name/
 +49 (0) 170 298 5667
 
 
 On 14 May 2013 14:43, Makru  wrote:
> Hello Lee,
> 
> thanks for your hint. Please have a look at:
> 
> https://gist.github.com/Makru/5575568 
> 
> This is my nginx.conf file, named blog.conf which is stored under 
> 
> /etc/nginx/conf.d/blog.conf  on the production server. Is there something 
> missing?
> 
> I am wondering about line 7 as comment: 
> 
>   # server_name example.com;
> 
> Something else missing or wrong?
> 
> 
> Regards
> Mathias
> 
> Am Dienstag, 14. Mai 2013 13:25:21 UTC+2 schrieb Makru:
>> Hello,
>> 
>> i am new to all related Ruby and Ruby on Rails and just started some 
>> weeks ago learning with tutorials and books.
>> 
>> Following one capistrano deployment tutorial, everything looks fine but 
>> the RoR application is not running.
>> 
>> CAP DEPLOY works according the Windows cmd-window but opening the 
>> webpage via a browser results in the:
>> 
>> Welcome aboard You’re riding Ruby on Rails!
>> 
>> -window, which is ok but if i go to the application, i get a 404 error 
>> from nginx.
>> 
>> 
>> 
>> I checked that Unicorn and NGINX are running on the Debian server. A 
>> restart does not help.
>> 
>> My enviroment :
>> 
>> Development Windows 7
>> Production Debian 6 with nginx and Unicorn
>> Ruby and Rails newest via RVM on Debian and Railsinstaller on Windows
>> Deployment using capistrano & github & SSH
>> Because i can not see a error during deployment i would be interested to 
>> know how to troubleshoot?
>> 
>> Many thanks in advance.
>> 
>> Best Regards
>> 
>> Mathias
> -- 
> -- 
> * You received this message because you are subscribed to the Google 
> Groups "Capistrano" group.
> * To post to this group, send email to capis...@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>>> -- 
>>> -- 
>>> * You received this message because you are subscribed to the Google Groups 
>>> "Capistrano" group.
>>> * To post to this group, send email to capis...@googlegroups.com
>>> * To unsubscribe from this group, send email to 
>>> capistrano+...@googlegr

Re: [capistrano] Re: After successful deployment app not running on production server (RoR/Capistrano/Github)

2013-05-14 Thread Donovan Bray
Does the app work in development mode locally?

On May 14, 2013, at 6:41 AM, Makru  wrote:

> Hello again,
> 
> nginxis running and showing the rails welcome page. Only the application and 
> the link at the Rails welcome page called 
> About your application’s environment
> 
> are not reachable and showing only:
> 
> 404 Not Found
> nginx/1.4.0
> 
> Thats why i am not sure, where the problem is
> 
> Regards
> 
> Mathias
> 
> 
> 
> 
> Am Dienstag, 14. Mai 2013 15:28:15 UTC+2 schrieb Lee Hambley:
>> 
>> Sorry Mathias,
>> 
>> This is the wrong place to get nginx support, I'd try #nginx on Freenode's 
>> IRC network.
>> 
>> (it's a time thing, perhaps someone else on the list can help you)
>> 
>> Lee Hambley
>> --
>> http://lee.hambley.name/
>> +49 (0) 170 298 5667
>> 
>> 
>> On 14 May 2013 14:43, Makru  wrote:
>>> Hello Lee,
>>> 
>>> thanks for your hint. Please have a look at:
>>> 
>>> https://gist.github.com/Makru/5575568 
>>> 
>>> This is my nginx.conf file, named blog.conf which is stored under 
>>> 
>>> /etc/nginx/conf.d/blog.conf  on the production server. Is there something 
>>> missing?
>>> 
>>> I am wondering about line 7 as comment: 
>>> 
>>>   # server_name example.com;
>>> 
>>> Something else missing or wrong?
>>> 
>>> 
>>> Regards
>>> Mathias
>>> 
>>> Am Dienstag, 14. Mai 2013 13:25:21 UTC+2 schrieb Makru:
 Hello,
 
 i am new to all related Ruby and Ruby on Rails and just started some weeks 
 ago learning with tutorials and books.
 
 Following one capistrano deployment tutorial, everything looks fine but 
 the RoR application is not running.
 
 CAP DEPLOY works according the Windows cmd-window but opening the webpage 
 via a browser results in the:
 
 Welcome aboard You’re riding Ruby on Rails!
 
 -window, which is ok but if i go to the application, i get a 404 error 
 from nginx.
 
 
 
 I checked that Unicorn and NGINX are running on the Debian server. A 
 restart does not help.
 
 My enviroment :
 
 Development Windows 7
 Production Debian 6 with nginx and Unicorn
 Ruby and Rails newest via RVM on Debian and Railsinstaller on Windows
 Deployment using capistrano & github & SSH
 Because i can not see a error during deployment i would be interested to 
 know how to troubleshoot?
 
 Many thanks in advance.
 
 Best Regards
 
 Mathias
 
 
 
 
>>> -- 
>>> -- 
>>> * You received this message because you are subscribed to the Google Groups 
>>> "Capistrano" group.
>>> * To post to this group, send email to capis...@googlegroups.com
>>> * To unsubscribe from this group, send email to 
>>> capistrano+...@googlegroups.com For more options, visit this group at 
>>> http://groups.google.com/group/capistrano?hl=en
>>> --- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Capistrano" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to capistrano+...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>  
>>>  
>> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Re: After successful deployment app not running on production server (RoR/Capistrano/Github)

2013-05-14 Thread Donovan Bray
Post a gist of your unicorn.rb

Make sure your unix sockets are pointing to the same place. 

Your nginx is pointing to /tmp/...

I'd hazzard a bet your unicorn.rb is pointing to the rails root tmp and not the 
root tmp dir. 

On May 14, 2013, at 5:43 AM, Makru  wrote:

> Hello Lee,
> 
> thanks for your hint. Please have a look at:
> 
> https://gist.github.com/Makru/5575568 
> 
> This is my nginx.conf file, named blog.conf which is stored under 
> 
> /etc/nginx/conf.d/blog.conf  on the production server. Is there something 
> missing?
> 
> I am wondering about line 7 as comment: 
> 
>   # server_name example.com;
> 
> Something else missing or wrong?
> 
> Regards
> Mathias
> 
> Am Dienstag, 14. Mai 2013 13:25:21 UTC+2 schrieb Makru:
>> 
>> Hello,
>> 
>> i am new to all related Ruby and Ruby on Rails and just started some weeks 
>> ago learning with tutorials and books.
>> 
>> Following one capistrano deployment tutorial, everything looks fine but the 
>> RoR application is not running.
>> 
>> CAP DEPLOY works according the Windows cmd-window but opening the webpage 
>> via a browser results in the:
>> 
>> Welcome aboard You’re riding Ruby on Rails!
>> 
>> -window, which is ok but if i go to the application, i get a 404 error from 
>> nginx.
>> 
>> 
>> 
>> I checked that Unicorn and NGINX are running on the Debian server. A restart 
>> does not help.
>> 
>> My enviroment :
>> 
>> Development Windows 7
>> Production Debian 6 with nginx and Unicorn
>> Ruby and Rails newest via RVM on Debian and Railsinstaller on Windows
>> Deployment using capistrano & github & SSH
>> Because i can not see a error during deployment i would be interested to 
>> know how to troubleshoot?
>> 
>> Many thanks in advance.
>> 
>> Best Regards
>> 
>> Mathias
>> 
>> 
>> 
>> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] After successful deployment app not running on production server (RoR/Capistrano/Github)

2013-05-14 Thread Donovan Bray
This isn't likely to be a capistrano issue. 

Shut nginx and unicorn down on the server. 

Make sure you've made provisions for doing all of the configuration required 
for RAILS_ENV=production and ensure you are launching unicorn with 
RAILS_ENV=production 

Verify you can run a 

rails console production 

>From the /current directory where your app is deployed. 

Start nginx and unicorn back up manually. Recheck your app. 

On May 14, 2013, at 4:25 AM, Makru  wrote:

> Hello,
> 
> i am new to all related Ruby and Ruby on Rails and just started some weeks 
> ago learning with tutorials and books.
> 
> Following one capistrano deployment tutorial, everything looks fine but the 
> RoR application is not running.
> 
> CAP DEPLOY works according the Windows cmd-window but opening the webpage via 
> a browser results in the:
> 
> Welcome aboard You’re riding Ruby on Rails!
> 
> -window, which is ok but if i go to the application, i get a 404 error from 
> nginx.
> 
> 
> 
> I checked that Unicorn and NGINX are running on the Debian server. A restart 
> does not help.
> 
> My enviroment :
> 
> Development Windows 7
> Production Debian 6 with nginx and Unicorn
> Ruby and Rails newest via RVM on Debian and Railsinstaller on Windows
> Deployment using capistrano & github & SSH
> Because i can not see a error during deployment i would be interested to know 
> how to troubleshoot?
> 
> Many thanks in advance.
> 
> Best Regards
> 
> Mathias
> 
> 
> 
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] slow `bundle:install` command during `deploy:finalize_update` task

2013-05-12 Thread Donovan Bray
I wrote my own bundler recipes that essentially caches the last successful
bundle.  That cache is then copied to the new timestamp release, and
rebundled for the new release. As long as no deploy failure happens then
the rebundled directory is copied back to the cache.

This also means a rollback is clean, because each timestamp release has the
bundle that matches it's Gemfile.lock.

See these links from my cap-recipes project:

https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/bundler/install.rb

https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/bundler/hooks.rb




On Sun, May 12, 2013 at 1:52 AM, Lee Hambley  wrote:

> Hi Tom,
>
> The Bundler team manage the Capistrano integration, and this problem comes
> up time and time again, it's done this way so that your installed
> "RELEASE_DIRECTORY" is a completely isolated copy of your app.
>
> You'd better raise the issue with the Bundler team, or at least check
> their faq/docs to see if what you are trying to do it already possible.
>
> As for "reasons against" - just that you are going against the grain, and
> trying to "break" a reliability feature for speed, but reliable, fast,
> cheap, pick two.
>
> - Lee
>
> Lee Hambley
> --
> http://lee.hambley.name/
> +49 (0) 170 298 5667
>
>
> On 12 May 2013 03:02, TomPave  wrote:
>
>> Hello,
>>
>> I'm trying to improve the speed of my deploy script.
>> As it is now it works perfectly, but `bundle:install` is incredibly slow:
>> it takes between 2 and 4 minutes every time.
>>
>>
>> I noticed that Capistrano doesn't use the default directory for the user
>> who executes the rack app server: ~/.rvm/
>> Rather, it installs the gems in the vendor folder of each release. for
>> example:
>>
>> /var/www/wonderingmachine/releases/20130512001352/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.2
>>
>> After Capistrano has slowly run `bundle:install`, I can run it manually
>> again and as expected it only takes few seconds (it doesn't need to install
>> any new gem).
>>
>>
>> I have a Gemfile and a Gemfile.lock in my app, and they are both checked
>> in the git repository. The Gemfile.lock doesn't change that often and I
>> don't see why Capistrano should download and install all the gems each time.
>> I imagine that using the default gem directory would speed thing up, as
>> Capistrano will need to install new gems only when I want it to update
>> something (that is, when I commit an updated Gemfile.lock)
>> Is there any reason why I shouldn't do it?
>>
>>
>>
>> Anyway, I see there is a variable names "bundle_dir".
>> Could you help me set it up?
>>
>>
>> # other ENV variables are set as well
>> #
>> default_environment["GEM_HOME"] =
>> "/home/runner/.rvm/gems/ruby-2.0.0-p0"
>> default_environment["GEM_PATH"] =
>> "/home/runner/.rvm/gems/ruby-2.0.0-p0:/home/runner/.rvm/gems/ruby-2.0.0-p0@global
>> "
>> set :bundle_dir, "?"
>>
>> Thanks a lot
>>
>> --
>> --
>> * You received this message because you are subscribed to the Google
>> Groups "Capistrano" group.
>> * To post to this group, send email to capistrano@googlegroups.com
>> * To unsubscribe from this group, send email to
>> capistrano+unsubscr...@googlegroups.com For more options, visit this
>> group at http://groups.google.com/group/capistrano?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Capistrano" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to capistrano+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> --
> * You received this message because you are subscribed to the Google
> Groups "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to
> capistrano+unsubscr...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/capistrano?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] executing a task without triggered "chained callbacks" ?

2013-04-26 Thread Donovan Bray
I've used this method to change which roles to use not to avoid callbacks as I 
mentioned how I deal with that earlier. But if you do use this remember you can 
make the body of the task a method and call the same method inside your 
different task and they will work based on the context of the task they are 
called inside. 

def logfoo
  logger.info "foo"
end

after :foo, :bar
task :foo do
  logfoo
end

task :bar do
  logger.info "bar"
end

task :foo_no_bar do
  logfoo
end


On Apr 26, 2013, at 4:55 AM, Lee Hambley  wrote:

> You have to change them so that you have my_task, no prerequisites, and 
> something like my_task_with_prerequisites
> 
> On Friday, April 26, 2013, henrique matias wrote:
>> Hello Folks,
>> 
>> On my deploy.rb i have a few tasks which are chained to others, but some 
>> times i would like to execute them without triggering the chained ones...
>> 
>> Am trying to find a "magic parameter" on docs, but perhaps am not the beset 
>> doc explorer ( :
>> 
>> peace
>> -- 
>> -- 
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to capistrano@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+unsubscr...@googlegroups.com For more options, visit this group 
>> at http://groups.google.com/group/capistrano?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to capistrano+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> -- 
> Lee Hambley
> --
> http://lee.hambley.name/
> +49 (0) 170 298 5667
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] executing a task without triggered "chained callbacks" ?

2013-04-26 Thread Donovan Bray
What I do is create my call chains based on a top level task like deploy or 
deploy:migrations

on :start, :only => :deploy do
  after "deploy:update_code", :bar
  before :bar, :foo
end

task :bar do
   logger.info "bar"
end

task :foo do
  logger.info "foo"
end

You can call foo and bar independently outside of a deploy. But during a deploy 
they will run in the correct order. 

On Apr 26, 2013, at 4:52 AM, henrique matias  wrote:

> Hello Folks,
> 
> On my deploy.rb i have a few tasks which are chained to others, but some 
> times i would like to execute them without triggering the chained ones...
> 
> Am trying to find a "magic parameter" on docs, but perhaps am not the beset 
> doc explorer ( :
> 
> peace
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Cron job replacement

2013-03-01 Thread Donovan Bray
I don't use cap/Jenkins for this but I do use it to do deploys. 

I prefer using resque or delayed_jobs for Ruby apps. I'm sure other languages 
have similar async frameworks. 

On Mar 1, 2013, at 12:24 PM, Serdar Sahin  wrote:

> Hi,
> 
> We have number of long running cron jobs and need to execute these jobs 
> locally in the server, as our LB timeouts them. For other jobs we use HTTP 
> based jobs and manage them in the jenkins.
> 
> Since we also want to manage these jobs in the Jenkins for debugging and 
> management purposes and provide HA for these jobs, we would like to utilise 
> capistrano's invoke command to choose one of the running servers and execute 
> the command locally. 
> 
> Is there any easy way to choose one of the web servers and try to invoke 
> command only in that server, and if that fails move to the second one, up 
> until the hard limit we define. (e.g. after 5 servers it should fail)
> 
> Thanks in advance,
> 
> 
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Abort capistrano deploy if no puppet exists

2013-02-28 Thread Donovan Bray
That actually only works if you have one server. If you have more than one you 
risk raising a positive when a different box doesn't have what you are 
which'ing. 

'which' will set an exit code > 0 if the executable is not found. Cap will 
abort on a failed command so all you need is

run "which puppet"

Better:

Test and see if it can respond with a more significant request. 

run "puppet agent --fingerprint"

Block deploys:

before :deploy do
   run "puppet agent --fingerprint"
end

YMMV as I don't use puppet. 


On Feb 28, 2013, at 7:28 AM, Peter M Souter  wrote:

> Hi guys,
> 
> Quick question: What would be the best way of making sure a service is 
> installed on the remote server, and then aborting if it's not?
> 
> Right now I have something like this: http://pastie.org/6354736
> 
> it seems a bit messy, but that's how I've seen it done in other capistrano 
> recipes that run a command that has an exit code.
> 
> Thanks!
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] branch name on server

2013-02-27 Thread Donovan Bray
Capistrano can deploy branches, tags, and sha's. 

In order to support tags and sha's it needs to ensure there is no ambiguity 
that's left on the remote box when it's done. 

'deploy' was chosen so that you KNOW that the sha it's pointing to is something 
other than a real branch name. 

For example lets say you deploy master. Then you deploy tag v1.2.2. 

Git will show that your still on master except HEAD will actually be pointing 
to the sha at the tip of v1.2.2. Confusing right? I know.  

Same thing occurs with deploying a specific sha. 

When you look closely at what capistrano does you begin finding out that cap 
enumerates whatever you specify in :branch as a sha; and you are actually 
always deploying via that sha; not checking out a branch. 

So cap creates a local branch called deploy and then resets its head to point 
to the sha that was enumerated at deploy time. 

You CAN change the 'deploy' name but you are playing with fire if you are 
counting on that name pointing to the same sha that origin/ does. 

On Feb 26, 2013, at 4:59 AM, fré de vries  wrote:

> Hi all,
> 
> When i run 'cap deploy' ,  capistrano checks out a new branch in the just 
> created releases/x/  directory.
> As i can see on my screen during deployment,  Capistrano does this with the 
> command 
> git checkout -q -b deploy a4f187cf3dbd4294dc2fb4cc31b222eed79c51d5
> 
> as you can see,  a new branch is created  name 'deploy' 
> 
> I do not like this, i'd like to name this branch after the branch being 
> checked out. So if i do 'cap -s branch=MY_BRANCH deploy' , the checkout 
> command should be
> git checkout -q -b MY_BRANCH a4f187cf3dbd4294dc2fb4cc31b222eed79c51d5
> 
> Can this be done?
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Capistrano - cleaning up old releases issue

2013-02-20 Thread Donovan Bray
You will need to override the cap variable shared_children in order to omit 
'system' from symlink activities during deploy. 

On Feb 20, 2013, at 6:36 AM, bsod99  wrote:

> Sorry for the delay on this - should there be something in the shared/pids 
> folder? mine are always empty (running ls -a). One thing which may or may not 
> be linked to the issue, is that capistrano is creating a "system" folder, in 
> shared. The framework I use for my sites also has a system folder, which 
> contains all the core framework files which are never edited. So my releases 
> folder would have the following for example:
> 
> app_public
> app_admin
> public_html
> system
> modules
> 
> And my shared folder would have
> 
> app_public -> containing some non-versioned config stuff symlinked to currnet
> app_admin -> same for this
> public_html -> same 
> cached-copy -> capistrano
> log -> capistrano
> pids -> capistrano
> system -> capistrano
> 
> On Thursday, 7 February 2013 16:44:41 UTC, dbray wrote:
>> 
>> Inspecting the contents and comparing the pids specified in the files vs the 
>> ones that are running may give you clues to the problem. 
>> 
>> Make a note of your pids pre-deploy; do the deploy then compare the pids 
>> previous; to the current pids; and to the pids in the directory. 
>> 
>> On Feb 7, 2013, at 6:45 AM, bsod99  wrote:
>> 
>>> Further update on this, in case it helps pinpoint the issue(s) - when an 
>>> error (as described above) arises after a deployment, if I remove the 
>>> releases/cached-copy/log/pids folders and run deploy:setup and deploy, my 
>>> sites work correctly. 
>>> 
>>> On Wednesday, 6 February 2013 21:49:09 UTC, bsod99 wrote:
 
 I'm on CentOS 6, standard LAMP setup. It's really puzzling.
 
 I wonder if I should just start afresh, as I've been messing about with 
 the deployment script a fair bit. 
 
 On Wednesday, 6 February 2013 17:46:37 UTC, dbray wrote:
> 
> What web server are you using. I experienced something similar with 
> unicorn. Because of its forking the master process it had already 
> resolved the symlink to a specific directory. Everything would work fine 
> until the original dir the master was originally started from finally got 
> cleaned up. 
> 
> I used to use passenger and it had similar issues until they incorporated 
> a patch to re-evaluate the symlink for each fork. 
> 
> On Feb 6, 2013, at 4:30 AM, bsod99  wrote:
> 
>> Thanks, switched to latest_release. All the targets exist in shared, and 
>> 'cap deploy:shared_symlinks' is executing successfully during the 
>> deployment. Checking the symlinks after shows they are correct. 
>> 
>> The cap task isn't raising any errors. The issue is that non-shared core 
>> classes in my application are sporadically not found after a deployment, 
>> even though these files are sitting in the current release in the 
>> correct place. Also, upon re-deploying, sometimes the error can be 
>> another core class which isn't found. This just adds to the confusion in 
>> that the error isn't consistent. 
>> 
>> For testing, I've set keep_releases to 1 for now - on a couple of sites, 
>> deployments are working fine, but on another, I'm having the issue 
>> described above. The deployment scripts are practically identical.
>> 
>> 
>> 
>> On Tuesday, 29 January 2013 17:26:33 UTC, dbray wrote:
>>> 
>>> It should be #{latest_release} not #{release_path}
>>> 
>>> release_path only works during a deploy; latest_release will work all 
>>> the time. 
>>> 
>>> See: 
>>> 
>>> https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy.rb
>>> 
>>> Have you ensured that all the targets in shared exist before attempting 
>>> to create the symlinks?
>>> 
>>> What isn't working about it?
>>> 
>>> Are you invoking 'cap deploy:shared_symlinks' then see my suggestion 
>>> above. 
>>> 
>>> Is the cap task raising an error; post a copy of a failed run. 
>>> 
>>> Is the task executing but you just don't end up with the symlinks?
>>> 
>>> Are there files pre-existing in the release directory from checkout; 
>>> you need to remove them in order to recreate them as symlinks. 
>>> 
>>> On Jan 29, 2013, at 3:30 AM, bsod99  wrote:
>>> 
 Alas, this still isn't correct - symlinking definitely a bit messed 
 up, Can anyone see what is wrong with this staging.rb script? 
 http://pastie.org/5927281
 I must still have the order wrong...thanks for any help
 
 
 On Thursday, 24 January 2013 09:47:59 UTC, bsod99 wrote:
> 
> Thanks for all the replies. I followed dbray's advice and kept 
> releases at, and adjusted sequencing to:
> 
> after "deploy:update", "deploy:symlink_shared"
> after "de

Re: [capistrano] Capistrano script to deploy ruby on Ubuntu?

2013-02-19 Thread Donovan Bray
See my cap-recipes project. 

https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/ruby19/install.rb



On Feb 19, 2013, at 4:03 AM, "Lance.Haig"  wrote:

> Hi Guys,
> 
> does anyone use capistrano to deploy ruby on a standard minimal ubuntu server?
> 
> I would appreciate it if you would be willing to share
> 
> Regards
> 
> Lance
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Re: Handling shell script prompts while calling shell on remote machine

2013-02-14 Thread Donovan Bray
Not my blog post; and I used to use that cleanup code but its slow, and gets  
linearly slower the more hosts you are deploying to so I eventually took it 
out. The default handling is good enough. 

But I've used that pattern a number of times to accomplish other things like 
for each server enumerate the ip of an eth interface then push down a specific 
file that matched that ip to that specific host. (This was to push down IPSec 
tunnel configurations that were tied to the private interfaces not the public 
ones that I was sshing to via cap, so the internal ips were unknown to cap ergo 
the per server enumeration)

On Feb 14, 2013, at 8:22 AM, Jonathan Rochkind  wrote:

> Neat i had been wondering how to do that too-- but also, that blog post 
> specifically suggests an improvement to the built in cleanup task, donovan 
> did you ever or can you pull request this improvement for inclusion in cap 
> distro, instead of it just sitting out on a blog post?
> 
> From: capistrano@googlegroups.com [capistrano@googlegroups.com] on behalf of 
> Donovan Bray [donno...@gmail.com]
> Sent: Thursday, February 14, 2013 11:13 AM
> To: capistrano@googlegroups.com
> Subject: Re: [capistrano] Re: Handling shell script prompts while calling 
> shell on remote machine
> 
> You can have a conversation and response per server by using the underlying 
> net ssh subsystem.
> 
> I avoid doing this like the plague but in some situations it's impossible to 
> do it any other way.
> 
> The following blog post presents a pattern that I've used a number of times 
> to do things similar to what you want to do.
> 
> http://blog.perplexedlabs.com/2010/09/08/improved-deploycleanup-for-capistrano/
> 
> 
> On Feb 13, 2013, at 5:56 PM, Eddie Du 
> mailto:sj.ed...@gmail.com>> wrote:
> 
> I would like to know as well!
> 
> I'm writing some install scripts with some prompts - I thought 
> default_run_options[:pty] = true is suppose to solve this but it didn't.
> 
> On Wednesday, May 25, 2011 1:34:11 PM UTC-4, Pawan wrote:
> Hi All,
> 
> I am using cap to call a push a script to remote which further
> downloads another script from http link which can contain any number
> of parameter prompt. But by running cap, the prompt waits, and if i
> enter value and click enter, it does not move to next.
> 
> Is there any way to make this user interactive.
> 
> 
> Thanks
> Pawan
> 
> --
> --
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to 
> capistrano@googlegroups.com<mailto:capistrano@googlegroups.com>
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com<mailto:capistrano+unsubscr...@googlegroups.com>
>  For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> ---
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to 
> capistrano+unsubscr...@googlegroups.com<mailto:capistrano+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> --
> --
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> ---
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
-- 
* You re

Re: [capistrano] Capistrano hangs when waiting for user input from pseudo-terminal

2013-02-14 Thread Donovan Bray
If you just want to pass input then you can use a helper like this which 
provides an answer based on a regex match of the prompt

https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/utilities.rb#L229

On Feb 13, 2013, at 4:32 PM, Eddie Du  wrote:

> (copied from my stackoverflow question - perhaps people here have an answer :)
> 
> I set up a basic config/deploy.rb file with a task:
> 
> task :blah do
>   run ". ~/blah.sh"
> end
> And on the server, the blah.sh file just prompts for input:
> 
> while true; do
> read -p "Say something: " blah
> done
> Capistrano connects to my server just fine, and normal commands work as well. 
> When I run cap blahit prompts me for input, but whatever I type, it's not 
> sending back to the server. The output looks like:
> 
>   * 2013-02-13 19:12:36 executing `blah'
>   * executing ". ~/blah.sh"
> servers: ["192.81.214.76"]
> [192.81.214.76] executing command
>  ** [out :: 192.81.214.76] Say something:
> And it doesn't respond no matter what I type.
> 
> Note I did set default_run_options[:pty] = true
> 
> I'm not even sure if this is a problem with my local setup or the server. Any 
> ideas?
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Re: Handling shell script prompts while calling shell on remote machine

2013-02-14 Thread Donovan Bray
You can have a conversation and response per server by using the underlying net 
ssh subsystem. 

I avoid doing this like the plague but in some situations it's impossible to do 
it any other way. 

The following blog post presents a pattern that I've used a number of times to 
do things similar to what you want to do. 

http://blog.perplexedlabs.com/2010/09/08/improved-deploycleanup-for-capistrano/


On Feb 13, 2013, at 5:56 PM, Eddie Du  wrote:

> I would like to know as well!
> 
> I'm writing some install scripts with some prompts - I thought 
> default_run_options[:pty] = true is suppose to solve this but it didn't.
> 
> On Wednesday, May 25, 2011 1:34:11 PM UTC-4, Pawan wrote:
>> 
>> Hi All, 
>> 
>> I am using cap to call a push a script to remote which further 
>> downloads another script from http link which can contain any number 
>> of parameter prompt. But by running cap, the prompt waits, and if i 
>> enter value and click enter, it does not move to next. 
>> 
>> Is there any way to make this user interactive. 
>> 
>> 
>> Thanks 
>> Pawan
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Capistrano - cleaning up old releases issue

2013-02-07 Thread Donovan Bray
Inspecting the contents and comparing the pids specified in the files vs the 
ones that are running may give you clues to the problem. 

Make a note of your pids pre-deploy; do the deploy then compare the pids 
previous; to the current pids; and to the pids in the directory. 

On Feb 7, 2013, at 6:45 AM, bsod99  wrote:

> Further update on this, in case it helps pinpoint the issue(s) - when an 
> error (as described above) arises after a deployment, if I remove the 
> releases/cached-copy/log/pids folders and run deploy:setup and deploy, my 
> sites work correctly. 
> 
> On Wednesday, 6 February 2013 21:49:09 UTC, bsod99 wrote:
>> 
>> I'm on CentOS 6, standard LAMP setup. It's really puzzling.
>> 
>> I wonder if I should just start afresh, as I've been messing about with the 
>> deployment script a fair bit. 
>> 
>> On Wednesday, 6 February 2013 17:46:37 UTC, dbray wrote:
>>> 
>>> What web server are you using. I experienced something similar with 
>>> unicorn. Because of its forking the master process it had already resolved 
>>> the symlink to a specific directory. Everything would work fine until the 
>>> original dir the master was originally started from finally got cleaned up. 
>>> 
>>> I used to use passenger and it had similar issues until they incorporated a 
>>> patch to re-evaluate the symlink for each fork. 
>>> 
>>> On Feb 6, 2013, at 4:30 AM, bsod99  wrote:
>>> 
 Thanks, switched to latest_release. All the targets exist in shared, and 
 'cap deploy:shared_symlinks' is executing successfully during the 
 deployment. Checking the symlinks after shows they are correct. 
 
 The cap task isn't raising any errors. The issue is that non-shared core 
 classes in my application are sporadically not found after a deployment, 
 even though these files are sitting in the current release in the correct 
 place. Also, upon re-deploying, sometimes the error can be another core 
 class which isn't found. This just adds to the confusion in that the error 
 isn't consistent. 
 
 For testing, I've set keep_releases to 1 for now - on a couple of sites, 
 deployments are working fine, but on another, I'm having the issue 
 described above. The deployment scripts are practically identical.
 
 
 
 On Tuesday, 29 January 2013 17:26:33 UTC, dbray wrote:
> 
> It should be #{latest_release} not #{release_path}
> 
> release_path only works during a deploy; latest_release will work all the 
> time. 
> 
> See: 
> 
> https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy.rb
> 
> Have you ensured that all the targets in shared exist before attempting 
> to create the symlinks?
> 
> What isn't working about it?
> 
> Are you invoking 'cap deploy:shared_symlinks' then see my suggestion 
> above. 
> 
> Is the cap task raising an error; post a copy of a failed run. 
> 
> Is the task executing but you just don't end up with the symlinks?
> 
> Are there files pre-existing in the release directory from checkout; you 
> need to remove them in order to recreate them as symlinks. 
> 
> On Jan 29, 2013, at 3:30 AM, bsod99  wrote:
> 
>> Alas, this still isn't correct - symlinking definitely a bit messed up, 
>> Can anyone see what is wrong with this staging.rb script? 
>> http://pastie.org/5927281
>> I must still have the order wrong...thanks for any help
>> 
>> 
>> On Thursday, 24 January 2013 09:47:59 UTC, bsod99  wrote:
>>> 
>>> Thanks for all the replies. I followed dbray's advice and kept releases 
>>> at, and adjusted sequencing to:
>>> 
>>> after "deploy:update", "deploy:symlink_shared"
>>> after "deploy:restart", "deploy:cleanup"
>>> 
>>> This seems to be working fine (and makes sense, having thought through 
>>> more carefully about what each is doing)
>>> 
>>> On Thursday, 24 January 2013 02:42:51 UTC, dbray  wrote:
 
 Keep releases should be 2 at minimum in my opinion
 
 On Jan 23, 2013, at 9:26 AM, bsod99  wrote:
 
> I followed the advice in another post about how to clean up old 
> capistrano releases, however, i've realised that the way I've 
> implemented this has messed up the paths in my application (just on a 
> staging site thankfully!). I am using the code below in my 
> config/deploy/staging.rb script, but it can't be running at the 
> correct point, as after deployment I end up with application failing 
> as it's trying to load classes from earlier releases. If I remove the 
> keep_releases line and the one below, and redeploy, everything works 
> again. Has anyone come across this issue?
> 
> set :use_sudo, false
> set :keep_releases, 1
> after "deploy:update", "deploy:cleanup"
> 
>

Re: [capistrano] [Help] Problem with EC2, Capistrano and Git

2013-02-06 Thread Donovan Bray
What is that supposed to do?  I've never seen or used that option. What happens 
if you rem it out?

On Feb 6, 2013, at 12:36 PM, Cândido Sales Gomes  wrote:

> dbray,
> 
> When I add these lines:
> 
> ssh_options[:config] = false
> 
> It connects, but I'm not allowed to do what capistrano asks.
> 
> Do you know why this happens?
> 
> Em quarta-feira, 6 de fevereiro de 2013 16h14min48s UTC-3, Cândido Sales 
> Gomes escreveu:
>> 
>> dbray,
>> 
>> The result: https://gist.github.com/candidosales/4698593
>> 
>> deploy.rb: https://gist.github.com/candidosales/4724969
>> 
>> My machine can connect, but not via capistrano. When I disable ssh_options 
>> [: config] to false it connects however I get no permissions to perform the 
>> capistrano/git needs.
>> 
>> Em quarta-feira, 6 de fevereiro de 2013 00h47min40s UTC-3, dbray escreveu:
>>> 
>>> What are the results of you doing the following where you are running 'cap':
>>> 
>>> ssh -v -A ubuntu@177.71.250.61
>>> 
>>> On Tue, Feb 5, 2013 at 6:30 PM, Cândido Sales Gomes  
>>> wrote:
 dbray,
 
 Thanks for the suggestion. I also tried on my local machine and the error 
 persists, the change in deploy.rb did as asked.
 
 deploy.rb: https://gist.github.com/candidosales/4710703
 
 error: https://gist.github.com/candidosales/4698593
 
 You have yet another suggestion that I may have been wrong?
 
 Em terça-feira, 5 de fevereiro de 2013 20h37min55s UTC-3, dbray escreveu:
> 
> On your workstation before deploying do this:
> 
> eval `ssh-agent`
> ssh-add
> ssh-add 
> 
> Then retry the cap command
> 
> I would not guarantee the the "~" symbol is expanded in your keys 
> variable. That method has never worked for me. It's not necessary if you 
> are using agent forwarding and could be fouling things up. 
> 
> 
> 
> On Feb 5, 2013, at 10:31 AM, Cândido Sales Gomes  
> wrote:
> 
>> I replaced all single quotes with double quotes, and still the error = / 
>> ... Anyone else?
>> 
>> Deploy.rb: https://gist.github.com/candidosales/4710703
>> 
>> Erro: https://gist.github.com/candidosales/4698593
>> 
>> Em terça-feira, 5 de fevereiro de 2013 13h03min33s UTC-3, dbray escreveu:
>>> 
>>> Why it's blowing up isn't because of ssh
>>> 
>>> set :deploy_to, '/var/www/#{application}'
>>> 
>>> set :current, '#{deploy_to}/current'
>>> 
>>> 
>>> Your quoting of strings is incorrect. 
>>> 
>>> Using single quotes creates a non-interpolated string. 
>>> 
>>> It's setting the variable to that literal string. 
>>> 
>>> Use double-quotes instead. 
>>> 
>>> 
>>> 
>>> 
>>> On Feb 4, 2013, at 5:52 PM, Cândido Sales Gomes  
>>> wrote:
>>> 
 Gentlemen,
 
 When I try to make a connection with capistrano on my EC2 presents 
 this error: https://gist.github.com/candidosales/4698593
 
 My deploy.rb: https://gist.github.com/candidosales/4710703
 
 When I created the SSH to connect to Github and my local machine to 
 the EC2 not used password or passphrase.
 
 I can connect my machine to the server with: ssh ubu...@177.71.250.61
 
 Have copied my id_rsa.pub to EC2: cat ~ / .ssh / id_rsa.pub | ssh-i ~ 
 / .ec2/midiaexterna-ec2.pem ubu...@177.71.250.61 "cat >> .ssh / 
 authorized_keys"
 
 Please, somebody help me 2 weeks try to make a simple connection with 
 capistrano.
 
 Thank you!
 -- 
 -- 
 * You received this message because you are subscribed to the Google 
 Groups "Capistrano" group.
 * To post to this group, send email to capis...@googlegroups.com
 * To unsubscribe from this group, send email to 
 capistrano+...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/capistrano?hl=en
 --- 
 You received this message because you are subscribed to the Google 
 Groups "Capistrano" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to capistrano+...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  
>> 
>> -- 
>> -- 
>> * You received this message because you are subscribed to the Google 
>> Groups "Capistrano" group.
>> * To post to this group, send email to capis...@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/capistrano?hl=en
>> --- 
>> You received this message because you are subscribed to the Google 
>> Groups "Capistrano" group.
>> To unsubscribe from this group and stop receiving emails from

[capistrano] Beware upstream net-ssh loose dependencies

2013-02-06 Thread Donovan Bray
http://solutious.com/blog/2013/02/06/so-i-made-5-mistakes-today/

>From the article:

>> I broke 
>> Chef.
I broke Vagrant . net-ssh
is pretty far upstream so in just a couple hours there were over 52,000
installs of the offending gems, *much to the chagrin of sysadmins and
devops folks everywhere.*
*
*
*>> Note: If you have any of the following gems installed on your system,
you should remove them: net-ssh-gateway-1.1.1, net-ssh-gateway-1.1.2,
net-ssh-multi-1.1.1, net-ssh-multi-1.1.2, net-scp-1.0.5, and net-scp-1.0.6.*

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Capistrano - cleaning up old releases issue

2013-02-06 Thread Donovan Bray
What web server are you using. I experienced something similar with unicorn. 
Because of its forking the master process it had already resolved the symlink 
to a specific directory. Everything would work fine until the original dir the 
master was originally started from finally got cleaned up. 

I used to use passenger and it had similar issues until they incorporated a 
patch to re-evaluate the symlink for each fork. 

On Feb 6, 2013, at 4:30 AM, bsod99  wrote:

> Thanks, switched to latest_release. All the targets exist in shared, and 'cap 
> deploy:shared_symlinks' is executing successfully during the deployment. 
> Checking the symlinks after shows they are correct. 
> 
> The cap task isn't raising any errors. The issue is that non-shared core 
> classes in my application are sporadically not found after a deployment, even 
> though these files are sitting in the current release in the correct place. 
> Also, upon re-deploying, sometimes the error can be another core class which 
> isn't found. This just adds to the confusion in that the error isn't 
> consistent. 
> 
> For testing, I've set keep_releases to 1 for now - on a couple of sites, 
> deployments are working fine, but on another, I'm having the issue described 
> above. The deployment scripts are practically identical.
> 
> 
> 
> On Tuesday, 29 January 2013 17:26:33 UTC, dbray wrote:
>> 
>> It should be #{latest_release} not #{release_path}
>> 
>> release_path only works during a deploy; latest_release will work all the 
>> time. 
>> 
>> See: 
>> 
>> https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy.rb
>> 
>> Have you ensured that all the targets in shared exist before attempting to 
>> create the symlinks?
>> 
>> What isn't working about it?
>> 
>> Are you invoking 'cap deploy:shared_symlinks' then see my suggestion above. 
>> 
>> Is the cap task raising an error; post a copy of a failed run. 
>> 
>> Is the task executing but you just don't end up with the symlinks?
>> 
>> Are there files pre-existing in the release directory from checkout; you 
>> need to remove them in order to recreate them as symlinks. 
>> 
>> On Jan 29, 2013, at 3:30 AM, bsod99  wrote:
>> 
>>> Alas, this still isn't correct - symlinking definitely a bit messed up, Can 
>>> anyone see what is wrong with this staging.rb script? 
>>> http://pastie.org/5927281
>>> I must still have the order wrong...thanks for any help
>>> 
>>> 
>>> On Thursday, 24 January 2013 09:47:59 UTC, bsod99 wrote:
 
 Thanks for all the replies. I followed dbray's advice and kept releases 
 at, and adjusted sequencing to:
 
 after "deploy:update", "deploy:symlink_shared"
 after "deploy:restart", "deploy:cleanup"
 
 This seems to be working fine (and makes sense, having thought through 
 more carefully about what each is doing)
 
 On Thursday, 24 January 2013 02:42:51 UTC, dbray wrote:
> 
> Keep releases should be 2 at minimum in my opinion
> 
> On Jan 23, 2013, at 9:26 AM, bsod99  wrote:
> 
>> I followed the advice in another post about how to clean up old 
>> capistrano releases, however, i've realised that the way I've 
>> implemented this has messed up the paths in my application (just on a 
>> staging site thankfully!). I am using the code below in my 
>> config/deploy/staging.rb script, but it can't be running at the correct 
>> point, as after deployment I end up with application failing as it's 
>> trying to load classes from earlier releases. If I remove the 
>> keep_releases line and the one below, and redeploy, everything works 
>> again. Has anyone come across this issue?
>> 
>> set :use_sudo, false
>> set :keep_releases, 1
>> after "deploy:update", "deploy:cleanup"
>> 
>> namespace :deploy do
>>   task :symlink_shared do
>> // run some commands i need
>>   end
>> end
>> 
>> before "deploy:restart", "deploy:symlink_shared"
>> -- 
>> * You received this message because you are subscribed to the Google 
>> Groups "Capistrano" group.
>> * To post to this group, send email to capis...@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/capistrano?hl=en
>>> 
>>> -- 
>>> -- 
>>> * You received this message because you are subscribed to the Google Groups 
>>> "Capistrano" group.
>>> * To post to this group, send email to capis...@googlegroups.com
>>> * To unsubscribe from this group, send email to 
>>> capistrano+...@googlegroups.com For more options, visit this group at 
>>> http://groups.google.com/group/capistrano?hl=en
>>> --- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Capistrano" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to capistrano+...@googlegroups.com.
>>> For 

Re: [capistrano] [Help] Problem with EC2, Capistrano and Git

2013-02-05 Thread Donovan Bray
What are the results of you doing the following where you are running 'cap':

ssh -v -A ubuntu@177.71.250.61

On Tue, Feb 5, 2013 at 6:30 PM, Cândido Sales Gomes wrote:

> dbray,
>
> Thanks for the suggestion. I also tried on my local machine and the error
> persists, the change in deploy.rb did as asked.
>
> deploy.rb: https://gist.github.com/candidosales/4710703
>
> error: https://gist.github.com/candidosales/4698593
>
> You have yet another suggestion that I may have been wrong?
>
> Em terça-feira, 5 de fevereiro de 2013 20h37min55s UTC-3, dbray escreveu:
>>
>> On your workstation before deploying do this:
>>
>> eval `ssh-agent`
>> ssh-add
>> ssh-add 
>>
>> Then retry the cap command
>>
>> I would not guarantee the the "~" symbol is expanded in your keys
>> variable. That method has never worked for me. It's not necessary if you
>> are using agent forwarding and could be fouling things up.
>>
>>
>>
>> On Feb 5, 2013, at 10:31 AM, Cândido Sales Gomes 
>> wrote:
>>
>> I replaced all single quotes with double quotes, and still the error = /
>> ... Anyone else?
>>
>> Deploy.rb: 
>> https://gist.**github.com/candidosales/**4710703
>>
>> Erro: 
>> https://gist.github.com/**candidosales/4698593
>>
>> Em terça-feira, 5 de fevereiro de 2013 13h03min33s UTC-3, dbray escreveu:
>>>
>>> Why it's blowing up isn't because of ssh
>>>
>>> set :deploy_to, '/var/www/#{application}'
>>> set :current, '#{deploy_to}/current'
>>>
>>> Your quoting of strings is incorrect.
>>>
>>> Using single quotes creates a non-interpolated string.
>>> It's setting the variable to that literal string.
>>>
>>> Use double-quotes instead.
>>>
>>>
>>>
>>> On Feb 4, 2013, at 5:52 PM, Cândido Sales Gomes 
>>> wrote:
>>>
>>> Gentlemen,
>>>
>>> When I try to make a connection with capistrano on my EC2 presents this
>>> error: 
>>> https://gist.github.com/**candidosales/4698593
>>>
>>> My deploy.rb: 
>>> https://gist.github.com/**candidosales/4710703
>>>
>>> When I created the SSH to connect to Github and my local machine to the
>>> EC2 not used password or passphrase.
>>>
>>> I can connect my machine to the server with: ssh ubu...@177.71.250.61
>>>
>>> Have copied my id_rsa.pub to EC2: cat ~ / .ssh / id_rsa.pub | ssh-i ~ /
>>> .ec2/midiaexterna-ec2.pem ubu...@177.71.250.61 "cat >> .ssh /
>>> authorized_keys"
>>>
>>> Please, somebody help me 2 weeks try to make a simple connection with
>>> capistrano.
>>>
>>> Thank you!
>>>
>>> --
>>> --
>>> * You received this message because you are subscribed to the Google
>>> Groups "Capistrano" group.
>>> * To post to this group, send email to capis...@googlegroups.com
>>> * To unsubscribe from this group, send email to
>>> capistrano+...@googlegroups.**com For more options, visit this group at
>>> http://groups.google.com/**group/capistrano?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Capistrano" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to capistrano+...@googlegroups.**com.
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>>  --
>> --
>> * You received this message because you are subscribed to the Google
>> Groups "Capistrano" group.
>> * To post to this group, send email to capis...@googlegroups.com
>> * To unsubscribe from this group, send email to capistrano+...@**
>> googlegroups.com For more options, visit this group at
>> http://groups.google.com/**group/capistrano?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Capistrano" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to capistrano+...@**googlegroups.com.
>> For more options, visit 
>> https://groups.google.com/**groups/opt_out
>> .
>>
>>
>>
>>  --
> --
> * You received this message because you are subscribed to the Google
> Groups "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to
> capistrano+unsubscr...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/capistrano?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googl

Re: [capistrano] [Help] Problem with EC2, Capistrano and Git

2013-02-05 Thread Donovan Bray
On your workstation before deploying do this:

eval `ssh-agent`
ssh-add
ssh-add 

Then retry the cap command

I would not guarantee the the "~" symbol is expanded in your keys variable. 
That method has never worked for me. It's not necessary if you are using agent 
forwarding and could be fouling things up. 



On Feb 5, 2013, at 10:31 AM, Cândido Sales Gomes  wrote:

> I replaced all single quotes with double quotes, and still the error = / ... 
> Anyone else?
> 
> Deploy.rb: https://gist.github.com/candidosales/4710703
> 
> Erro: https://gist.github.com/candidosales/4698593
> 
> Em terça-feira, 5 de fevereiro de 2013 13h03min33s UTC-3, dbray escreveu:
> Why it's blowing up isn't because of ssh
> 
> set :deploy_to, '/var/www/#{application}'
> set :current, '#{deploy_to}/current'
> 
> Your quoting of strings is incorrect. 
> 
> Using single quotes creates a non-interpolated string. 
> It's setting the variable to that literal string. 
> 
> Use double-quotes instead. 
> 
> 
> 
> On Feb 4, 2013, at 5:52 PM, Cândido Sales Gomes  wrote:
> 
>> Gentlemen,
>> 
>> When I try to make a connection with capistrano on my EC2 presents this 
>> error: https://gist.github.com/candidosales/4698593
>> 
>> My deploy.rb: https://gist.github.com/candidosales/4710703
>> 
>> When I created the SSH to connect to Github and my local machine to the EC2 
>> not used password or passphrase.
>> 
>> I can connect my machine to the server with: ssh ubu...@177.71.250.61
>> 
>> Have copied my id_rsa.pub to EC2: cat ~ / .ssh / id_rsa.pub | ssh-i ~ / 
>> .ec2/midiaexterna-ec2.pem ubu...@177.71.250.61 "cat >> .ssh / 
>> authorized_keys"
>> 
>> Please, somebody help me 2 weeks try to make a simple connection with 
>> capistrano.
>> 
>> Thank you!
>> -- 
>> -- 
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to capis...@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/capistrano?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to capistrano+...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] [Help] Problem with EC2, Capistrano and Git

2013-02-05 Thread Donovan Bray
Why it's blowing up isn't because of ssh

set :deploy_to, '/var/www/#{application}'
set :current, '#{deploy_to}/current'

Your quoting of strings is incorrect. 

Using single quotes creates a non-interpolated string. 
It's setting the variable to that literal string. 

Use double-quotes instead. 



On Feb 4, 2013, at 5:52 PM, Cândido Sales Gomes  wrote:

> Gentlemen,
> 
> When I try to make a connection with capistrano on my EC2 presents this 
> error: https://gist.github.com/candidosales/4698593
> 
> My deploy.rb: https://gist.github.com/candidosales/4710703
> 
> When I created the SSH to connect to Github and my local machine to the EC2 
> not used password or passphrase.
> 
> I can connect my machine to the server with: ssh ubuntu@177.71.250.61
> 
> Have copied my id_rsa.pub to EC2: cat ~ / .ssh / id_rsa.pub | ssh-i ~ / 
> .ec2/midiaexterna-ec2.pem ubuntu@177.71.250.61 "cat >> .ssh / authorized_keys"
> 
> Please, somebody help me 2 weeks try to make a simple connection with 
> capistrano.
> 
> Thank you!
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Should capistrano manage unicorn.rb?

2013-02-04 Thread Donovan Bray
I use god to manage unicorn and cap to manipulate god. 

https://github.com/donnoman/cap-recipes/tree/master/lib/cap_recipes/tasks/unicorn

Deploy is a delicate dance, cap needs to lead at all times lest your partner 
step on your foot. 

On Feb 4, 2013, at 11:15 AM, Boris Quiroz  wrote:

> Well, that's more or less the question. I've an environment with unicorn and 
> nginx, and our old deployment process was using Chef (manually running 
> chef-client on every machine and then restart unicorn process). Right now I'm 
> migrating that deployment process to Capistrano and I wanted to know, 
> according to the experience of the people on this group, what is the best way 
> to manage unicorn, using Capistrano or continue managing using Chef?
> 
> I've been reading about this gem 
> https://github.com/sosedoff/capistrano-unicorn, I've done some tests on 
> staging environment, but I'm not 100% sure if that is the best option so any 
> comment and/or advice is welcome!
> 
> Thanks.
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] `initialize': Input/output error when trying to write a yml file.

2013-02-02 Thread Donovan Bray
File.open is executed on the machine RUNNING capistrano not the remote
machines.

You need to use a method like 'put' to do what it looks like you are
intendeding

https://github.com/capistrano/capistrano/wiki/2.x-DSL-Action-File-Transfer-Put

task :update_locals do
  options_hash =  { key1: value1 }
  put options_hash.to_yaml, "#{latest_release}/config/locals.yml"
end

Also, use 'latest_release' instead of 'current_path'. If you call your
current task during a deploy (and it had actually worked) you would have
written the file to release directory that is about to be replaced, rather
than the one being actually deployed to.

There are actually very few valid reasons to use ANY other method than
#{latest_release} in your recipes to target something to happen in your
release directory.

from:
https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy.rb

# some tasks, like symlink, need to always point at the latest release, but
# they can also (occassionally) be called standalone. In the standalone case,
# the timestamped release_path will be inaccurate, since the directory won't
# actually exist. This variable lets tasks like symlink work either in the
# standalone case, or during deployment.
_cset(:latest_release) { exists?(:deploy_timestamped) ? release_path :
current_release }


On Wed, Jan 30, 2013 at 7:19 PM, macsig  wrote:

> Hello there.
> I'm trying to write my first very simple capistrano recipe that updates a
> value stored in a yml file.
>
> The recipe is simple as:
>
> task :update_locals do
>   options_hash = { key1: value1 }
>   File.open("#{current_path}/config/locals.yml", 'w+') {|f|
> f.write(options_hash.to_yaml) }
> end
>
> But when I run it I get
>
> `initialize': Input/output error -
> /home/userx/apps/appx/current/config/locals.yml (Errno::EIO)
>
> Am I missing something?
>
> I'm running ruby 1.9.3 and capistrano 2.14.1
>
>
>
> Thanks for the help and have a good day.
>
> --
> --
> * You received this message because you are subscribed to the Google
> Groups "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to
> capistrano+unsubscr...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/capistrano?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] tasks being executed on unexpected servers

2013-01-29 Thread Donovan Bray
My inclination is to not address it. It's better we use the methods and 
attributed as they were designed creating aliases in code just makes for 
tougher refactors. 

Keep in mind it's not failing silently. You are editing an arbitrary hash. You 
could have just as easily said :goober => true and somehere else :only => { 
:goober => true }

Some things in the options hash have meaning to capistrano. The rest is for you 
to extend the framework. 

To say throw an error with an options hash if it's not understood would create 
a very shallow and inflexible framework. You should know those options hash may 
be tossed around going 3 to 5 levels deep. Level 3 may not understand :goober. 
But the 5th level may. 

On Jan 29, 2013, at 6:31 PM, Jonathan Rochkind  wrote:

> Have you in particular done the :role instead of :roles typo many times?
> 
> If this is common, should we patch to introduce :role as a synonym for 
> :roles?  Especially since if you get it wrong, it just fails silently with no 
> hints as to why. 
> From: capistrano@googlegroups.com [capistrano@googlegroups.com] on behalf of 
> Donovan Bray [donno...@gmail.com]
> Sent: Tuesday, January 29, 2013 8:02 PM
> To: capistrano@googlegroups.com
> Subject: Re: [capistrano] tasks being executed on unexpected servers
> 
> The school of hard knocks; leaves marks I've done that to myself many 
> times.
> 
> On Tue, Jan 29, 2013 at 7:12 AM, Jonathan Rochkind  wrote:
> Aha, thank you!
> 
> 
> 
> On 1/28/2013 10:54 PM, Donovan Bray wrote:
> It should be:
> 
> task :deploy, :roles .
> 
> Note the 's'
> 
> :roles => :app
> :roles => [:app]
> :roles => [:app, :web]
> 
> Are all valid on a task object
> 
> 
> On Jan 28, 2013, at 1:05 PM, Jonathan Rochkind  wrote:
> 
> Okay, I'm not sure if I've confused about the basic way cap roles work, or 
> something else is going on, or what.
> 
> I have two servers, defined like:
> 
> server "main.example.org", :app, :web, :db, :primary => true
> 
> role :my_custom_role, "special.example.org"
> 
> 
> Then I have a custom task, defined like:
> 
>  namespace :my_custom_thing do
> task :deploy, :role => :app do
> # do some things, including
> top.upload(some_file, some_destination_path)
> end
>  end
> 
> I had thought that if I ran "cap my_custom_thing:deploy", it would only 
> execute that task on servers with role app, meaning only try to run that 
> manual 'upload' to main.example.org (which has role :app), and not upload it 
> to special.example.org (which does not have role :app).
> 
> Yet, when I role it... it tries to upload the file to BOTH main.example.org, 
> and special.example.org.
> 
> Am I fundamentally misunderstanding how this stuff works? Or from what I've 
> described, ought it to be only doing the upload to the single server called 
> main.example.org with role :app ?
> 
> --
> --
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> 
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> 

Re: [capistrano] tasks being executed on unexpected servers

2013-01-29 Thread Donovan Bray
The school of hard knocks; leaves marks I've done that to myself many
times.

On Tue, Jan 29, 2013 at 7:12 AM, Jonathan Rochkind  wrote:

> Aha, thank you!
>
>
>
> On 1/28/2013 10:54 PM, Donovan Bray wrote:
>
>> It should be:
>>
>> task :deploy, :roles .
>>
>> Note the 's'
>>
>> :roles => :app
>> :roles => [:app]
>> :roles => [:app, :web]
>>
>> Are all valid on a task object
>>
>>
>> On Jan 28, 2013, at 1:05 PM, Jonathan Rochkind  wrote:
>>
>>  Okay, I'm not sure if I've confused about the basic way cap roles work,
>>> or something else is going on, or what.
>>>
>>> I have two servers, defined like:
>>>
>>> server "main.example.org", :app, :web, :db, :primary => true
>>>
>>> role :my_custom_role, "special.example.org"
>>>
>>>
>>> Then I have a custom task, defined like:
>>>
>>>  namespace :my_custom_thing do
>>> task :deploy, :role => :app do
>>> # do some things, including
>>> top.upload(some_file, some_destination_path)
>>> end
>>>  end
>>>
>>> I had thought that if I ran "cap my_custom_thing:deploy", it would only
>>> execute that task on servers with role app, meaning only try to run that
>>> manual 'upload' to main.example.org (which has role :app), and not
>>> upload it to special.example.org (which does not have role :app).
>>>
>>> Yet, when I role it... it tries to upload the file to BOTH
>>> main.example.org, and special.example.org.
>>>
>>> Am I fundamentally misunderstanding how this stuff works? Or from what
>>> I've described, ought it to be only doing the upload to the single server
>>> called main.example.org with role :app ?
>>>
>>> --
>>> --
>>> * You received this message because you are subscribed to the Google
>>> Groups "Capistrano" group.
>>> * To post to this group, send email to capistrano@googlegroups.com
>>> * To unsubscribe from this group, send email to capistrano+unsubscribe@*
>>> *googlegroups.com  For more
>>> options, visit this group at http://groups.google.com/**
>>> group/capistrano?hl=en <http://groups.google.com/group/capistrano?hl=en>
>>> --- You received this message because you are subscribed to the Google
>>> Groups "Capistrano" group.
>>> To unsubscribe from this group, send email to capistrano+unsubscribe@**
>>> googlegroups.com .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
> --
> --
> * You received this message because you are subscribed to the Google
> Groups "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to capistrano+unsubscribe@**
> googlegroups.com  For more
> options, visit this group at http://groups.google.com/**
> group/capistrano?hl=en <http://groups.google.com/group/capistrano?hl=en>
> --- You received this message because you are subscribed to the Google
> Groups "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> capistrano+unsubscribe@**googlegroups.com
> .
>
> For more options, visit 
> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> .
>
>
>

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Capistrano - cleaning up old releases issue

2013-01-29 Thread Donovan Bray
It should be #{latest_release} not #{release_path}

release_path only works during a deploy; latest_release will work all the time. 

See: 

https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy.rb

Have you ensured that all the targets in shared exist before attempting to 
create the symlinks?

What isn't working about it?

Are you invoking 'cap deploy:shared_symlinks' then see my suggestion above. 

Is the cap task raising an error; post a copy of a failed run. 

Is the task executing but you just don't end up with the symlinks?

Are there files pre-existing in the release directory from checkout; you need 
to remove them in order to recreate them as symlinks. 

On Jan 29, 2013, at 3:30 AM, bsod99  wrote:

> Alas, this still isn't correct - symlinking definitely a bit messed up, Can 
> anyone see what is wrong with this staging.rb script? 
> http://pastie.org/5927281
> I must still have the order wrong...thanks for any help
> 
> 
> On Thursday, 24 January 2013 09:47:59 UTC, bsod99 wrote:
> Thanks for all the replies. I followed dbray's advice and kept releases at, 
> and adjusted sequencing to:
> 
> after "deploy:update", "deploy:symlink_shared"
> after "deploy:restart", "deploy:cleanup"
> 
> This seems to be working fine (and makes sense, having thought through more 
> carefully about what each is doing)
> 
> On Thursday, 24 January 2013 02:42:51 UTC, dbray wrote:
> Keep releases should be 2 at minimum in my opinion
> 
> On Jan 23, 2013, at 9:26 AM, bsod99  wrote:
> 
>> I followed the advice in another post about how to clean up old capistrano 
>> releases, however, i've realised that the way I've implemented this has 
>> messed up the paths in my application (just on a staging site thankfully!). 
>> I am using the code below in my config/deploy/staging.rb script, but it 
>> can't be running at the correct point, as after deployment I end up with 
>> application failing as it's trying to load classes from earlier releases. If 
>> I remove the keep_releases line and the one below, and redeploy, everything 
>> works again. Has anyone come across this issue?
>> 
>> set :use_sudo, false
>> set :keep_releases, 1
>> after "deploy:update", "deploy:cleanup"
>> 
>> namespace :deploy do
>>   task :symlink_shared do
>> // run some commands i need
>>   end
>> end
>> 
>> before "deploy:restart", "deploy:symlink_shared"
>> -- 
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to capis...@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/capistrano?hl=en
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] tasks being executed on unexpected servers

2013-01-28 Thread Donovan Bray
It should be:

task :deploy, :roles .

Note the 's'

:roles => :app
:roles => [:app]
:roles => [:app, :web]

Are all valid on a task object 


On Jan 28, 2013, at 1:05 PM, Jonathan Rochkind  wrote:

> Okay, I'm not sure if I've confused about the basic way cap roles work, or 
> something else is going on, or what.
> 
> I have two servers, defined like:
> 
>server "main.example.org", :app, :web, :db, :primary => true
> 
>role :my_custom_role, "special.example.org"
> 
> 
> Then I have a custom task, defined like:
> 
> namespace :my_custom_thing do
>task :deploy, :role => :app do
># do some things, including
>top.upload(some_file, some_destination_path)
>end
> end
> 
> I had thought that if I ran "cap my_custom_thing:deploy", it would only 
> execute that task on servers with role app, meaning only try to run that 
> manual 'upload' to main.example.org (which has role :app), and not upload it 
> to special.example.org (which does not have role :app).
> 
> Yet, when I role it... it tries to upload the file to BOTH main.example.org, 
> and special.example.org.
> 
> Am I fundamentally misunderstanding how this stuff works? Or from what I've 
> described, ought it to be only doing the upload to the single server called 
> main.example.org with role :app ?
> 
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Deploy from two repositories

2013-01-28 Thread Donovan Bray
In myapp1 use a 'after "deploy:update", "deploy:configure_images"'

In that task you handle the prerequisite. 

Either it's symlink to the images directory if myapp2 is located somewhere else 
on the box. 

If myapp2 is only installed to be consumed by myapp1 you may want to use a 
helper like git-clone-or-pull from here to put it in the shared or a common 
location.

https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/utilities.rb#L284

An example of it being used is here: 

https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/nginx/install.rb#L125

On Jan 28, 2013, at 5:39 AM, Boris Quiroz  wrote:

> Hi,
> 
> I'm new here and I've a question that could be really silly, so any RTFM is 
> welcome.
> 
> I've a rails app, let's say github.com:Boris/MyApp1 but when I deploy it I've 
> to include some images located on github.com:Boris/MyApp2 so when 'cap 
> deploy' runs I got following error:
> 
> *** [err :: 10.0.1.95] find:
> *** [err :: 10.0.1.95] `/srv/MyApp1/releases/20130128133020/public/images '
> *** [err :: 10.0.1.95] : No such file or directory
> 
> Is there any way, maybe with before task, that fetch the content of 
> "public/images" and then run 'cap deploy'?
> 
> Thanks for your help!
> -- 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to capistrano+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [capistrano] Matching an OR on multiple keys in the :only conditional?

2013-01-23 Thread Donovan Bray
Glad it worked for you

Donovan Bray
Registered Capistrano Abuser

On Jan 23, 2013, at 12:29 PM, Christopher Opena  wrote:

> Many thanks for the response, Donovan.  In truth we're abusing a lot of 
> Capistrano's default workings due to our current setup (almost a thousand 
> instances of a single app, each of which could be on any given server as 
> :primary and any given server as :secondary, depending on current 
> conditions).  Basically we've defined our instances in one yaml and servers 
> in another yaml, and these yaml files are constantly shifting and being 
> updated due to environmental factors so our tasks have to be pretty flexible 
> in how to define the members of a given role.
> 
> We do load in all of the roles before any of the tasks are defined, so that 
> should at least help here.
> 
> In any case, I have modified the task to your suggestion and it works 
> perfectly - thanks!
> 
> On Tue, Jan 22, 2013 at 6:28 PM, Donovan Bray  wrote:
> I think you are abusing primary and the :only clause
> 
> I would create specific roles and target tasks to those roles. 
> 
> Ie 
> 
> server 'server20', :app, :app_primary
> server 'server21', :app, :app_secondary
> server 'server22'. :app
> 
> Now you can cut your servers all 3 ways by role. 
> 
> If you insist on doing an 'OR' it will need to look something like this:
> 
> task :test, :hosts => find_servers(:roles => :app, :only =>{:primary => 
> true}) + find_servers(:roles => :app, :only =>{:secondary => true}) do ...
> 
> That makes the huge assumption you assign all of the servers and roles before 
> that task is defined in ruby; otherwise you'll always end up with an empty 
> list. 
> 
> If that's the case you have to do it on the run command that way the 
> find_servers method is evaluated at runtime as opposed to load time. 
> 
> task :test do
>   run "uptime", :hosts => find_servers(:roles => :app, :only =>{:primary => 
> true}) + find_servers(:roles => :app, :only =>{:secondary => true})
> end
> 
> 
> On Jan 21, 2013, at 11:50 AM, Christopher Opena  wrote:
> 
>> Is it possible to pass an OR conditional into the :only check?  I know that 
>> it expects an array of key/value pairs so you can essentially do an AND 
>> inside of the hash, but what if you want to check on multiple keys in the 
>> conditional?
>> 
>> Example:
>> 
>> I have ten servers in a bank that are all serving the application.  At any 
>> point in time, only the :primary and the :secondary should have actions 
>> performed on them.  Through capistrano definitions I have managed to pass 
>> :primary => true and :secondary => true into those two servers, such that 
>> (stripped all the other servers out of the array to save space):
>> 
>> [
>> #> @hash=-2051751815,
>> @host="server21.domain.com",
>> @options={:secondary=>true},
>> @port=nil,
>> @to_s="u...@server21.domain.com",
>> @user="user">,
>> #> @hash=6964762022,
>> @host="server20.domain.com",
>> @options={:primary=>true},
>> @port=nil,
>> @to_s="u...@server20.domain.com",
>> @user="user">,
>> #> @hash=-447395779,
>> @host="server22.domain.com",
>> @options={},
>> @port=nil,
>> @to_s="u...@server22.domain.com",
>> @user="user">,
>> ]
>> 
>> If I want to run a task *only* on those two (the list is much longer, just 
>> stripped for this example), is there some iteration of :only that allows me 
>> to do that?  I have attempted:
>> 
>> task :test, :roles => [:app], :only => {:primary => true} || {:secondary => 
>> true} do; run "hostname"; end
>> 
>> But it only executes on the first matching hash of k,v pair.  And of course, 
>> if you do:
>> 
>> task :test, :roles => [:app], :only => {:primary => true, :secondary => 
>> true} do; run "hostname"; end
>> 
>> It will attempt to match both k,v pairs.  Anyone have any suggestions?  It's 
>> probably just something syntactical that I'm totally overlooking.
>> 
>> Thanks in advance,
>> Chris.
>> -- 
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to capistrano@googlegroups.com
>> * To unsubscribe from this group, send email to 
>>

Re: [capistrano] Capistrano deployment development environment

2013-01-23 Thread Donovan Bray
It's like killing a snail with a sledgehammer.  But it can do it.  

Caps default timestamping isn't going to be nice if your purpose is to develop 
inside the released code. 

What's your intentions when the code is there?

On Jan 23, 2013, at 4:03 AM, Gurdipe Dosanjh  wrote:

> Hi
> 
> I am new to using Capistrano and wondering  how I can use it to simply 
> automate the process of checking out a svm code branch on linux.
> 
> Regards
> 
> Gurdipe
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Capistrano - cleaning up old releases issue

2013-01-23 Thread Donovan Bray
Keep releases should be 2 at minimum in my opinion

On Jan 23, 2013, at 9:26 AM, bsod99  wrote:

> I followed the advice in another post about how to clean up old capistrano 
> releases, however, i've realised that the way I've implemented this has 
> messed up the paths in my application (just on a staging site thankfully!). I 
> am using the code below in my config/deploy/staging.rb script, but it can't 
> be running at the correct point, as after deployment I end up with 
> application failing as it's trying to load classes from earlier releases. If 
> I remove the keep_releases line and the one below, and redeploy, everything 
> works again. Has anyone come across this issue?
> 
> set :use_sudo, false
> set :keep_releases, 1
> after "deploy:update", "deploy:cleanup"
> 
> namespace :deploy do
>   task :symlink_shared do
> // run some commands i need
>   end
> end
> 
> before "deploy:restart", "deploy:symlink_shared"
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Capistrano - cleaning up old releases issue

2013-01-23 Thread Donovan Bray
Your cleanup is running wy to early; it should be 

after 'deploy:restart', 'deploy:cleanup'

I would also suggest moving any symlinking to after 'deploy:update'

On Jan 23, 2013, at 9:26 AM, bsod99  wrote:

> I followed the advice in another post about how to clean up old capistrano 
> releases, however, i've realised that the way I've implemented this has 
> messed up the paths in my application (just on a staging site thankfully!). I 
> am using the code below in my config/deploy/staging.rb script, but it can't 
> be running at the correct point, as after deployment I end up with 
> application failing as it's trying to load classes from earlier releases. If 
> I remove the keep_releases line and the one below, and redeploy, everything 
> works again. Has anyone come across this issue?
> 
> set :use_sudo, false
> set :keep_releases, 1
> after "deploy:update", "deploy:cleanup"
> 
> namespace :deploy do
>   task :symlink_shared do
> // run some commands i need
>   end
> end
> 
> before "deploy:restart", "deploy:symlink_shared"
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Matching an OR on multiple keys in the :only conditional?

2013-01-23 Thread Donovan Bray
I think you are abusing primary and the :only clause

I would create specific roles and target tasks to those roles. 

Ie 

server 'server20', :app, :app_primary
server 'server21', :app, :app_secondary
server 'server22'. :app

Now you can cut your servers all 3 ways by role. 

If you insist on doing an 'OR' it will need to look something like this:

task :test, :hosts => find_servers(:roles => :app, :only =>{:primary => true}) 
+ find_servers(:roles => :app, :only =>{:secondary => true}) do ...

That makes the huge assumption you assign all of the servers and roles before 
that task is defined in ruby; otherwise you'll always end up with an empty 
list. 

If that's the case you have to do it on the run command that way the 
find_servers method is evaluated at runtime as opposed to load time. 

task :test do
  run "uptime", :hosts => find_servers(:roles => :app, :only =>{:primary => 
true}) + find_servers(:roles => :app, :only =>{:secondary => true})
end


On Jan 21, 2013, at 11:50 AM, Christopher Opena  wrote:

> Is it possible to pass an OR conditional into the :only check?  I know that 
> it expects an array of key/value pairs so you can essentially do an AND 
> inside of the hash, but what if you want to check on multiple keys in the 
> conditional?
> 
> Example:
> 
> I have ten servers in a bank that are all serving the application.  At any 
> point in time, only the :primary and the :secondary should have actions 
> performed on them.  Through capistrano definitions I have managed to pass 
> :primary => true and :secondary => true into those two servers, such that 
> (stripped all the other servers out of the array to save space):
> 
> [
> # @hash=-2051751815,
> @host="server21.domain.com",
> @options={:secondary=>true},
> @port=nil,
> @to_s="u...@server21.domain.com",
> @user="user">,
> # @hash=6964762022,
> @host="server20.domain.com",
> @options={:primary=>true},
> @port=nil,
> @to_s="u...@server20.domain.com",
> @user="user">,
> # @hash=-447395779,
> @host="server22.domain.com",
> @options={},
> @port=nil,
> @to_s="u...@server22.domain.com",
> @user="user">,
> ]
> 
> If I want to run a task *only* on those two (the list is much longer, just 
> stripped for this example), is there some iteration of :only that allows me 
> to do that?  I have attempted:
> 
> task :test, :roles => [:app], :only => {:primary => true} || {:secondary => 
> true} do; run "hostname"; end
> 
> But it only executes on the first matching hash of k,v pair.  And of course, 
> if you do:
> 
> task :test, :roles => [:app], :only => {:primary => true, :secondary => true} 
> do; run "hostname"; end
> 
> It will attempt to match both k,v pairs.  Anyone have any suggestions?  It's 
> probably just something syntactical that I'm totally overlooking.
> 
> Thanks in advance,
> Chris.
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Where do you store server info used by Capistrano?

2012-12-20 Thread Donovan Bray
Hostnames are assigned to roles in tasks. 

Ssh preferences like enabling agent forwarding are set in deploy.rb

set :user, 'blah'

Is in the deploy.rb

All else is left up to the user. 

On Dec 19, 2012, at 7:19 PM, Huiming Teo  wrote:

> Hi all, wish to hear your thoughts on this:
> 
> Where do you prefer to store server info (e.g. hostname, ssh login user, ssh 
> key path) used by Capistrano? Do you store them in ~/.ssh/config, deploy.rb 
> (or Capistrano multistage .rb files) or else where?
> 
> Currently I keep them in ~/.ssh/config, but thinking of moving them into 
> deploy.rb.
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] precompile assets task, roles

2012-12-05 Thread Donovan Bray
This may help

https://github.com/capistrano/capistrano/pull/32

On Dec 5, 2012, at 6:43 AM, Jonathan Rochkind  wrote:

> I am actually still unable to find any docs of the ROLES env variable, or " 
> ROLE(S)FILTER" (not even sure what that means!).  Can anyone point me to the 
> right place?
> 
> From: capistrano@googlegroups.com [capistrano@googlegroups.com] on behalf of 
> Jonathan Rochkind [rochk...@jhu.edu]
> Sent: Wednesday, December 05, 2012 9:40 AM
> To: capistrano@googlegroups.com
> Subject: RE: [capistrano] precompile assets task, roles
> 
> Ah, okay, I'll look around for docs. (ROLES seemed to do what I needed at 
> first, but clearly not! Still confused on what it does, but i'll look around, 
> although had trouble finding docs before, I just got it from someone elses 
> (misleading) blog post).
> 
> What I _want_ to do is "Run only the tasks applicable for role X, on the 
> servers for role X. Pretend nothing but role X exists."
> 
> Make sense?  Is there no way to do it?  Am I a unique snowflake, or is this a 
> common use case? (It seems to me like it would be common).  I am indeed using 
> custom roles -- but I don't want to have to remember the current 
> configuration of which servers have which roles (nor do I neccesarily want to 
> run ALL tasks on that server(s), I just want the run the ones for certain 
> roles).  Is there any way to set that up?
> 
> If not, and I'm not a unique snowflake, would the capistrano committers look 
> kindly on a pull request to add the feature, if I can figure out how?  Any 
> comments on what the end-user-facing cli api should look like (since ROLES is 
> apparently already taken!)
> ____
> From: capistrano@googlegroups.com [capistrano@googlegroups.com] on behalf of 
> Donovan Bray [donno...@gmail.com]
> Sent: Tuesday, December 04, 2012 11:55 PM
> To: capistrano@googlegroups.com
> Subject: Re: [capistrano] precompile assets task, roles
> 
> ROLES probably doesn't do what you think it does; look at the docs for 
> ROLE(S)FILTER as well.
> 
> I've never found either to be useful so I avoid them like the plague.
> 
> Instead I build custom roles.
> 
> I define stages in tasks and use the server helper instead of the role helper.
> 
> 
> 
> On Dec 4, 2012, at 3:15 PM, Jonathan Rochkind  wrote:
> 
>> Huh, actually, it looks like this IS working as expected normally...
>> 
>> Where it broke is when I ran:
>> 
>> `cap ROLES=indexer_jobs deploy`
>> 
>> Somehow when you tell it to only run on servers with listed role... THEN it 
>> messes up and runs tasks that don't apply to that role on those servers too? 
>> Maybe?  Ring a bell for anyone? Is this a bug?
>> 
>> On 12/4/2012 6:13 PM, Jonathan Rochkind wrote:
>>> My cap recipe for a Rails app has just grown to more than one server;
>>> 
>>> I now have a server where the source is installed (in order to then set
>>> some rake cronjobs on that server), but it's not actually an app/web
>>> server.
>>> 
>>> So I don't want asset precompile to run there.
>>> 
>>> But asset precompile seems to be running there anyway. Looking at the
>>> actual code at:
>>> https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy/assets.rb
>>> 
>>> 
>>> I'm not sure why... it looks like it should only run the
>>> assets:precompile task on servers with role `assets_role`, which
>>> defaults to `web`.
>>> 
>>> This server does not have the role 'web', in fact it only has one role,
>>> one custom one I made up ("indexer_jobs")... but the assets:precompile
>>> task seems to be triggered there anyway.
>>> 
>>> Anyone have any clues what might be going on, or suggestions for how I
>>> can get to the bottom of this?
>>> 
>> 
>> --
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to capistrano@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+unsubscr...@googlegroups.com For more options, visit this group 
>> at http://groups.google.com/group/capistrano?hl=en
> 
> --
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegr

Re: [capistrano] precompile assets task, roles

2012-12-04 Thread Donovan Bray
ROLES probably doesn't do what you think it does; look at the docs for 
ROLE(S)FILTER as well. 

I've never found either to be useful so I avoid them like the plague. 

Instead I build custom roles. 

I define stages in tasks and use the server helper instead of the role helper. 



On Dec 4, 2012, at 3:15 PM, Jonathan Rochkind  wrote:

> Huh, actually, it looks like this IS working as expected normally...
> 
> Where it broke is when I ran:
> 
> `cap ROLES=indexer_jobs deploy`
> 
> Somehow when you tell it to only run on servers with listed role... THEN it 
> messes up and runs tasks that don't apply to that role on those servers too? 
> Maybe?  Ring a bell for anyone? Is this a bug?
> 
> On 12/4/2012 6:13 PM, Jonathan Rochkind wrote:
>> My cap recipe for a Rails app has just grown to more than one server;
>> 
>> I now have a server where the source is installed (in order to then set
>> some rake cronjobs on that server), but it's not actually an app/web
>> server.
>> 
>> So I don't want asset precompile to run there.
>> 
>> But asset precompile seems to be running there anyway. Looking at the
>> actual code at:
>> https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy/assets.rb
>> 
>> 
>> I'm not sure why... it looks like it should only run the
>> assets:precompile task on servers with role `assets_role`, which
>> defaults to `web`.
>> 
>> This server does not have the role 'web', in fact it only has one role,
>> one custom one I made up ("indexer_jobs")... but the assets:precompile
>> task seems to be triggered there anyway.
>> 
>> Anyone have any clues what might be going on, or suggestions for how I
>> can get to the bottom of this?
>> 
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en


Re: [capistrano] Automating Capistrano with a Ruby On Rails Application

2012-10-29 Thread Donovan Bray
For these types of jobs I use ci like cruisecontrol.rb or jenkins. 

Just pass your variables on the command line:

val=1 val2=two cap whatever

On Oct 26, 2012, at 10:13 PM, Cory Logan  wrote:

> Hey all. I'm trying use Capistrano for the purpose of third party backup 
> audits. I've got a set of capistrano tasks that are happily able to compare a 
> few checksums and report back. That's great, but I'd like to be able to 
> automate this process via a web interface, and also schedule this task. I 
> think a rails app would be a good fit to do that. The only way that I've 
> figured out how to do that would be something like this 
> 
> cap compare_checksums -S origin_server=some.server.com -S 
> destination_server=somewhereelse.com
> 
> It's cool, I can pass in all of the values I need to have something that's 
> dynamically reusable. But I'm bothered by the fact that I would have to sort 
> of exit my rails app to do it. Additionally, I would like the rails app to be 
> able to send an email alert if there's something wrong with my checksums. 
> 
> Anyway, that solution just feels a bit clunky to me. Anyone know how to run 
> capistrano and pass it variable from within my rails application? Would you 
> advise doing so? And how about getting output back from my capistrano tasks 
> for emailing out? Or can you think of an altogether better way to do it?
> 
> Thank you!
> Cory
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] recipe to detokenize files

2012-10-15 Thread Donovan Bray
Take a look at this nginx recipe it has a pattern I commonly use to sed files 
in place 

https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/nginx/install.rb

Take a look specifically at the configure task and it's associated sets at the 
top of the namespace 

On Oct 8, 2012, at 5:37 PM, ellandir  wrote:

> Hi,
> 
> I am kind of new to Capistrano so not sure where the best resources for 
> recipes are (I've been though the official wiki pages though).
> 
> I am looking for a recipe to detokenize files within a given folder. Any idea 
> if that exists already (otherwise I'll create the script, just trying to not 
> reinvent the wheel)?
> 
> Let's say I have a source folder /src, with a bunch of files and subfolders.
> some of them will contain tokens like %PASSWORD%, or %DOMAIN%.
> I need the recipe to take an input 'properties file' like:
> PASSWORD=xyz
> DOMAIN=hellworld.com
> 
> and replace the tokens of all files in /src by the values specified in that 
> properties file; put the resulting files/folders in a folder /dest.
> 
> So in my example, if a file /src/db/testfile contained dbpassword=%PASSWORD%, 
> I should get a file /dest/db/testfile with dbpassword=xyz   (simple string 
> replacement)
> 
> 
> 
> 
> Laurent
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Re: `query_revision': Unable to resolve revision for

2012-10-05 Thread Donovan Bray
My comment wasn't definitive it was just a guess, I avoid slashes because I 
know my CI chokes on them.

On Oct 4, 2012, at 6:23 PM, Jeremy Kitchen  wrote:

> On Thu, Oct 04, 2012 at 05:57:56PM -0700, Donovan Bray wrote:
>> My first assumption is that it doesn't like the forward slash in the branch 
>> name. Several tools I know choke on it. 
>> 
>> Create a branch with dash or underscore and retry. 
> 
> strange. I actually just set up my cap scripts to deploy branches like
> this the other day and haven't had any issues with slashes in the branch
> name.
> 
> I'm running cap 2.9.0 on centos 5.6 if that makes a difference.
> 
> -Jeremy

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en


Re: [capistrano] Re: `query_revision': Unable to resolve revision for

2012-10-04 Thread Donovan Bray
My first assumption is that it doesn't like the forward slash in the branch 
name. Several tools I know choke on it. 

Create a branch with dash or underscore and retry. 

On Oct 4, 2012, at 12:10 PM, Jesse  wrote:

> 040777

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en


Re: [capistrano] shared bundle versioning

2012-10-01 Thread Donovan Bray

Even before bundler came with cap tasks built In I anticipated this problem. I 
use my own bundler recipes 
https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/bundler/install.rb

It creates a bundled directory in shared but it's not symlinked. Instead it's 
used like a cache to seed a new release directory; where bundler is ultimately 
run.  A succesful deploy copies the resulting bundle back to shared to be used 
for the next deploy. 

Because each release ends up with its own bundle a rollback works exactly as 
expected since its the same bundle that was deployed for THAT revision of code. 
 Because the bundle doesn't need to be recalculated rollback is fast. The 
downside is a mature code base will have a big bundle and you have to tune how 
many release directories you want to keep. 

On Oct 1, 2012, at 1:02 PM, Ethan Waldo  wrote:

> We recently came across a situation where we couldn't rollback a deployment 
> because the new deployment borked the gems in the bundler gem cache.  
> Capistrano does a great job of versioning the code, but it seems to me that 
> the bundle of gems should be versioned as well to ensure the rollback will 
> succeed.
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Permission Denied Error: fopen('/usr/lib/ssl/openssl.cnf','rb')

2012-08-30 Thread Donovan Bray
Maybe gist your deploy.rb. Because I think your off in the weeds. The stuff 
your messing with I've never had to mess with including compiling nginx from 
scratch to support ssl. 

Maybe check 

https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/nginx/install.rb

To see how I install nginx. 

On Aug 29, 2012, at 9:53 PM, blueHandTalking  wrote:

> I am attempting to configure ssl in Nginx for the first time.
> 
> I am getting the following error from
> 
>cap deploy
> 
> Error:
> 
> [err :: 209.166.65.132] 15643:error:0200100D:system
> library:fopen:Permission denied:bss_file.c:126:fopen('/usr/lib/ssl/
> openssl.cnf','rb')
> 
> I have the following in my deploy.rb:
> 
> set :user,"deployer"
> set :group,   "staff"
> set :use_sudo,false
> 
> 
> 
> /usr/lib/ssl/openssl.cnf is a symlink to /etc/ssl/openssl.cnf,
> 
> group 'staff' , which 'deployer' is a member of, has read permission
> for /etc/ssl/openssl.cnf,
> and the symlink is root/root for user and group---with 777 permissions
> which is normal.
> 
> However, I am unable to do a : less /etc/ssl/openss.cnf
> 
> when I am logged in as deployer.
> 
> So perhaps I do not have a good grasp of the permission system. I
> realize that /etc and /etc/ssl
> are owned by root---but I thought that if staff is the group for /etc/
> ssl/openssl.cnf, deployer belongs
> to staff, and the group permission for /etc/ssl/openssl.cnf is read---
> I should be able to read that file?
> 
> Testing path:
> 
> sudo openssl verify -CApath /etc/ssl/certs server.pem
> Error opening certificate file server.pem
> 
> ***FAILED***
> 
> Testing Connection:
> 
> sudo openssl s_client -connect aceleathergoods.net:443 -CApath /etc/
> ssl/
> CONNECTED(0003)
> depth=1 /O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing
> Authority/emailAddress=supp...@cacert.org
> verify return:1
> depth=0 /CN=aceleathergoods.net
> verify return:1
> ---
> Certificate chain
> 0 s:/CN=aceleathergoods.net
>   i:/O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/
> emailAddress=supp...@cacert.org
> 1 s:/O=CAcert Inc./OU=http://www.CAcert.org/CN=CAcert Class 3 Root
>   i:/O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/
> emailAddress=supp...@cacert.org
> 2 s:/O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/
> emailAddress=supp...@cacert.org
>   i:/O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/
> emailAddress=supp...@cacert.org
> ---
> -(truncated results)
> 
> o client certificate CA names sent
> ---
> SSL handshake has read 5755 bytes and written 319 bytes
> 
> (truncated results)
> 
>  Start Time: 1346278528
>Timeout   : 300 (sec)
>Verify return code: 0 (ok)
> ---
> read:errno=0
> 
> End Result: Success connecting ( at least rest of report did not
> seem to indicate any errors).
> 
> So if someone could straighten me out on where I am going wrong on
> permissions I would really appreciate it.
> Permissions are the default on my Debian Squeeze installation.
> 
> Thanks!
> 
>   Jet
> 
> 
> 
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en


Re: [capistrano] how to change deployment from public folder to another folder

2012-08-27 Thread Donovan Bray
Looks like you may be using nginx to front the app;

  root <%=deploy_to%>/current/public; # <--- be sure to point to 'public'!

On Aug 24, 2012, at 3:53 PM, Megha Agrawal  wrote:

> Hi,
> 
> I have deployed a rails application. But when I start the server it, gives 
> the following error:
> 
> 2012/08/24 18:14:19 [error] 3870#0: *4 
> "/home/agrawalm/wwbp-mturk-staging/public/index.html" is not found (2: No 
> such file or directory), client: 127.0.0.1, server: _, request: "HEAD / 
> HTTP/1.1", host: "0.0.0.0"
> 
> I an using capistrano multistage and currently deployed in staging stage. In 
> staging.rb, I have :
> set :deploy_to, "/home/agrawalm/wwbp-mturk-staging"
> 
> When it deploys the latest version go to current folder in 
> /home/agrawalm/wwbp-mturk-staging and thus the error as it does not find any 
> public folder there. 
> 
> Can I set the deploy_to to /home/agrawalm/wwbp-mturk-staging/current/public  
> ??
> 
> Thanks,
> Megha
> 
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en


Re: [capistrano] how to change deployment from public folder to another folder

2012-08-27 Thread Donovan Bray
set :deploy_to, "/home/agrawalm/wwbp-mturk-staging"

Is the correct deploy_to

Unless you've mucked with capistrano internals the repo will be deployed to a 
timestamped directory under releases and on successful deploy a symlink will be 
created that points current to the timestamped release directory. 

Based in your error log you have an incorrect path in your runner. Ie whatever 
you are using to serve the app. 

What are you using, thin, passenger, unicorn?

On Aug 24, 2012, at 3:53 PM, Megha Agrawal  wrote:

> Hi,
> 
> I have deployed a rails application. But when I start the server it, gives 
> the following error:
> 
> 2012/08/24 18:14:19 [error] 3870#0: *4 
> "/home/agrawalm/wwbp-mturk-staging/public/index.html" is not found (2: No 
> such file or directory), client: 127.0.0.1, server: _, request: "HEAD / 
> HTTP/1.1", host: "0.0.0.0"
> 
> I an using capistrano multistage and currently deployed in staging stage. In 
> staging.rb, I have :
> set :deploy_to, "/home/agrawalm/wwbp-mturk-staging"
> 
> When it deploys the latest version go to current folder in 
> /home/agrawalm/wwbp-mturk-staging and thus the error as it does not find any 
> public folder there. 
> 
> Can I set the deploy_to to /home/agrawalm/wwbp-mturk-staging/current/public  
> ??
> 
> Thanks,
> Megha
> 
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en


Re: [capistrano] Capistrano?

2012-08-23 Thread Donovan Bray
The project was originally named switchtower; however the company that owned 
the trademark for that name asked Jamis to change it. 

http://weblog.jamisbuck.org/2006/3/3/switchtower-c-d

Jamis discusses the new capistrano name here: 

http://weblog.jamisbuck.org/2006/3/6/switchtower-renamed

It's just a nonsensical name, it was chosen for factors other than any hidden 
meaning of the name. 


On Aug 23, 2012, at 7:02 AM, jcochran  wrote:

> Where did the name "Capistrano" come from? Why was it chosen? It seems like 
> such an odd name for it.
> 
> It is an old Italian name. "Strano" means strange and during the time period 
> when surnames were adopted, various suffixes were added to people's names in 
> Italy differentiate between families with similar names. Someone with a name 
> like Capitano (several variations are Italian surnames today) probably moved 
> to a town where a Capitano family already lived and the new name stuck.
> 
> Alternatively, "capi" means understand in Italian, so it could come from 
> "understand strange", like a translator, and the original Capistrano was an 
> early forerunner of ItalianDict.com.
> 
> http://www.spanishdict.com/answers/108198/what-does-capistrano-mean
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Re: Deploy not updating site

2012-08-21 Thread Donovan Bray
Ignore my advice on order of location blocks; nginx has a specific order of 
precedence and order doesn't matter. 

See location description here: http://wiki.nginx.org/HttpCoreModule

I would rewrite your asset location block like this:

location ^~ /assets/ { # matches any query beginning with /assets/ and halts 
searching, # so regular expressions will not be checked.

On Aug 20, 2012, at 10:57 PM, blueHandTalking  wrote:

> Here is gist of nginx.conf and sites-enabled/default
> 
>   git://gist.github.com/3412424.git
> 
> On Aug 20, 9:53 pm, Donovan Bray  wrote:
>> Need to know what your nginx config looks like.
>> 
>> On Aug 20, 2012, at 8:12 PM, blueHandTalking  wrote:
>> 
>>> I am deploying a site that is using nginx and capistrano and git.
>> 
>>> My deploy.rb uses a git repository on a remote site that also has my
>>> web server.
>> 
>>> The site is deployed correctly,  excepting nginx not serving static
>>> assets.
>> 
>>> However any changes I make that are pushed to the remote git are not
>>> propagated
>>> on my site.
>> 
>>> Here is a gist of the deploy.rb that I am using:
>> 
>>>   git://gist.github.com/3411133.git
>> 
>>> Any thoughts or suggestions appreciated.
>> 
>>> This is my first attempt at using nginx, unicorn, git, and capistrano
>>> to deploy a site.
>> 
>>> Thanks!
>> 
>>>Jet
>> 
>>> --
>>> * You received this message because you are subscribed to the Google Groups 
>>> "Capistrano" group.
>>> * To post to this group, send email to capistrano@googlegroups.com
>>> * To unsubscribe from this group, send email to 
>>> capistrano+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/capistrano?hl=en
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Re: Deploy not updating site

2012-08-21 Thread Donovan Bray
I would move your location that matches assets above the root location. 

As long as your root is specified at the server level you don't need to 
redefine the roots inside the location blocks.   

Take a look at: 
https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/nginx_unicorn/app.conf

That configuration works for me for a number of applications. 

Lastly can you gist your unicorn.rb and command you are invoking unicorn with?

On Aug 20, 2012, at 10:57 PM, blueHandTalking  wrote:

> Here is gist of nginx.conf and sites-enabled/default
> 
>   git://gist.github.com/3412424.git
> 
> On Aug 20, 9:53 pm, Donovan Bray  wrote:
>> Need to know what your nginx config looks like.
>> 
>> On Aug 20, 2012, at 8:12 PM, blueHandTalking  wrote:
>> 
>>> I am deploying a site that is using nginx and capistrano and git.
>> 
>>> My deploy.rb uses a git repository on a remote site that also has my
>>> web server.
>> 
>>> The site is deployed correctly,  excepting nginx not serving static
>>> assets.
>> 
>>> However any changes I make that are pushed to the remote git are not
>>> propagated
>>> on my site.
>> 
>>> Here is a gist of the deploy.rb that I am using:
>> 
>>>   git://gist.github.com/3411133.git
>> 
>>> Any thoughts or suggestions appreciated.
>> 
>>> This is my first attempt at using nginx, unicorn, git, and capistrano
>>> to deploy a site.
>> 
>>> Thanks!
>> 
>>>Jet
>> 
>>> --
>>> * You received this message because you are subscribed to the Google Groups 
>>> "Capistrano" group.
>>> * To post to this group, send email to capistrano@googlegroups.com
>>> * To unsubscribe from this group, send email to 
>>> capistrano+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/capistrano?hl=en
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en


Re: [capistrano] Deploy not updating site

2012-08-20 Thread Donovan Bray
Need to know what your nginx config looks like. 

On Aug 20, 2012, at 8:12 PM, blueHandTalking  wrote:

> I am deploying a site that is using nginx and capistrano and git.
> 
> My deploy.rb uses a git repository on a remote site that also has my
> web server.
> 
> The site is deployed correctly,  excepting nginx not serving static
> assets.
> 
> However any changes I make that are pushed to the remote git are not
> propagated
> on my site.
> 
> Here is a gist of the deploy.rb that I am using:
> 
>   git://gist.github.com/3411133.git
> 
> Any thoughts or suggestions appreciated.
> 
> This is my first attempt at using nginx, unicorn, git, and capistrano
> to deploy a site.
> 
> Thanks!
> 
>Jet
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en


Re: [capistrano] New Documentation Site

2012-08-11 Thread Donovan Bray
Thanks Lee, I appreciate your excellent stewardship of Capistrano, and I think 
the new name will help folks find the docs with less noise. 

I'm in the habit of always pre pending 'ruby' to my google queries for ruby 
based queries. 

Google, 'god' vs 'ruby god' as an example. Talk about noise

On Aug 11, 2012, at 6:49 AM, Lee Hambley  wrote:

> Hi All,
> 
> I've moved the documentation (formerly "Wiki -> Documentation v2.x") to a 
> Github Pages site hosted in a `gh-pages` branch of the main repository.
> 
> The domain capify.org redirects to capistranorb.com, which is registered via 
> the Github CNAME (nice feature for gh-pages) file for the gh-pages branch.
> 
> The wiki page might still be there, it can probably be removed, and time will 
> tell - someone will delete it; they always do.
> 
> Pull requests for documentation are more than welcome, but we had to tighten 
> controls a little, as the wiki page was disappearing once a week, with people 
> often helpfuly reorganising, without realising that we relied on that page 
> for our two main domains.
> 
> Footnote, the domain "Capistranorb.com" is the one I would prefer to use 
> going forward, on the wave of ".js" and ".rb" named projects, and to further 
> distance Capistrano(.rb) from it's namesake city in California.
> 
> The site is the result of an hours work on my vacation time, please feel free 
> to pull request improvements.
> 
> - Lee
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Test Passes when when run individually but fails when run from a suite

2012-08-07 Thread Donovan Bray
Perhaps one of the other scripts that you are running in the same ruby process 
has already mocked or stubbed the Capistrano::Configuration class. 

On Aug 7, 2012, at 12:55 AM, Senthil Kumaran  wrote:

> Here is my simple test code which is similar to capistrano tests, but I am 
> running it on with extension recipes - http://uthcode.codepad.org/tiKrAZKZ
> This when I run it on command like it works,
> 
> ruby test_build.rb 
> Loaded suite test_build
> Started
> .
> Finished in 0.012566 seconds.
> 
> 1 tests, 1 assertions, 0 failures, 0 errors
> 
> But if I invoke it via along with bunch of other scripts, I get an error 
> something like this 
> 
>   1) Error:
> test_build(BuildTest):
> NoMethodError: undefined method `dry_run=' for nil:NilClass
> ./test_build.rb:13:in `test_build'
> 
> /opt/twitter/rvm/gems/ree-1.8.7-2012.02@default/gems/mocha-0.12.2/lib/mocha/monkey_patching/test_unit/ruby_version_186_and_above.rb:22:in
>  `__send__'
> 
> /opt/twitter/rvm/gems/ree-1.8.7-2012.02@default/gems/mocha-0.12.2/lib/mocha/monkey_patching/test_unit/ruby_version_186_and_above.rb:22:in
>  `run'
> 
> 
> What could be the problem and how do I resolve it?
> 
> Thanks,
> Senthil
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Role definition doesn't obey optional servers

2012-07-31 Thread Donovan Bray
My monkeypatch is here: 

https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/provision/empty_roles.rb

No per task configuration required. 

On Jul 31, 2012, at 8:46 AM, Jonathan Rochkind  wrote:

> Sorry, I missed the beginning of the thread, but is the problem that cap is 
> raising an error for an empty role?
> 
> This is under-documented, but is changeable. I use sometimes-empty roles too, 
> for the same reasons Donovan says, I agree it is a quite useful and not 
> unique use case.
> 
> To make it work, every task assigned to that role that might be empty, I need 
> to do this:
> 
> task :some_task, :roles => :might_be_empty, :on_no_matching_servers => 
> :continue
> 
> It is annoying, and I agree that this empty roles are VERY convenient for 
> exactly the reasons Donovan says but it is POSSIBLE, you've just got to 
> do that :on_no_matching_servers => :continue on every task that might be in 
> an empty role.
> 
> On 7/31/2012 11:25 AM, Donovan Bray wrote:
>> I disagree. I specifically monkey patch cap to allow this behavior.
>> 
>> In some stages I need a front end nginx loadbalancer and some cases I
>> don't because I'm either using Zeus or an ELB. I can use Role targeting
>> in my stage files by either including a nginx role or omit it, and a cap
>> deploy will do the right thing in all three cases and all I had to do
>> was manipulate the role assignments on the server objects.
>> 
>> Once you embrace the concept that roles can be empty it opens up a whole
>> new level of flexibility for stage definition.
>> 
>> I think it's an artificial constraint that has no pros.
>> 
>> If you don't like empty roles don't define them.  If you inadvertently
>> don't populate a role you'll figure it out in short order without cap
>> raising an exception.
>> 
>> 
>> On Jul 31, 2012, at 1:40 AM, Lee Hambley > <mailto:lee.hamb...@gmail.com>> wrote:
>> 
>>> The documentation is almost certainly wrong, there's been a lot of
>>> changes to this code from various patches since the docs were written.
>>> Unfortunately being in a Wiki we can't take documentation patches
>>> along with code patches in the pull requests, and people often forget
>>> to update the docs once we mere their pull request. Perhaps you'd like
>>> to update them to reflect the current behavior?
>>> 
>>> (I can't see a case for running a task with an empty list of servers
>>> for a role, Capistrano is a tool for working on remote hosts, if you
>>> have a task that doesn't have remote hosts, it's probably a rake task)
>>> 
>>> Cheers, Lee
>>> 
>>> --
>>> * You received this message because you are subscribed to the Google
>>> Groups "Capistrano" group.
>>> * To post to this group, send email to capistrano@googlegroups.com
>>> <mailto:capistrano@googlegroups.com>
>>> * To unsubscribe from this group, send email to
>>> capistrano+unsubscr...@googlegroups.com
>>> <mailto:capistrano+unsubscr...@googlegroups.com> For more options,
>>> visit this group at http://groups.google.com/group/capistrano?hl=en
>> 
>> --
>> * You received this message because you are subscribed to the Google
>> Groups "Capistrano" group.
>> * To post to this group, send email to capistrano@googlegroups.com
>> * To unsubscribe from this group, send email to
>> capistrano+unsubscr...@googlegroups.com For more options, visit this
>> group at http://groups.google.com/group/capistrano?hl=en
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en


Re: [capistrano] unable to clear precompile error in asset pipeline in production

2012-07-31 Thread Donovan Bray
What's at

Line 18
app/views/layouts/application.html.erb

Check your gemfile.lock for anything tinymce


On Jul 31, 2012, at 11:59 AM, Bakki Kudva  wrote:

> app/views/layouts/application.html.erb:18

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] When to run Jammit?

2012-07-31 Thread Donovan Bray
create_symlink is probably the safest, because you want to make sure all of 
your config files have been pushed and migrations run. If you use update_code 
and your rake invokes the environment before configs and migrations you could 
get an error from the rails stack that has nothing to do with assets. 

Best to tackle the actual reason it's failing rather than change the hook. 

For that unless it's actually related to capistrano you should ask in the 
jammit forums. 

I use the standard rails 3 asset pipeline so I can't help with jammit. 

On Jul 31, 2012, at 1:28 AM, ffjia  wrote:

> Hi there,
> 
> In many online documents/blogs, it is recommended to run task to minify and 
> bundle assets using "jammit" after "deploy:create_symlink" [0].
> 
> But, for some reasons, jammit task may fail, this way, end users will see 404 
> errors. Is it better to run jammit before "deploy:create_symlink"?
> 
> Thanks.
> 
> 
> [0] http://afreshcup.com/home/2010/1/18/notes-on-using-jammit-with-rails.html
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] jenkins to capistrano;how to verify whether the git tag exists or not?

2012-07-31 Thread Donovan Bray
def check_rev
  #whatever you need to do; return falsy on failure
end

before :deploy do
   raise Capistrano::Error, "invalid revision" unless check_rev 
end

On Jul 30, 2012, at 11:28 PM, habi  wrote:

> I searched but could not find an answer hence asking here.
> The setup is such a way that jenkins will ask the user for git tag(var name 
> TAG) and once they enter build stage will run 'cap deploy -s branch=${TAG}'.
> The setup works fine but is there any way we can add a check point to the 
> capistrano script so that it will exit before deploy if the TAG does not 
> exist?
> I know this can be done by writing a custom script but can we integrate to 
> cap?
> 
> -habi
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Role definition doesn't obey optional servers

2012-07-31 Thread Donovan Bray
I disagree. I specifically monkey patch cap to allow this behavior. 

In some stages I need a front end nginx loadbalancer and some cases I don't 
because I'm either using Zeus or an ELB. I can use Role targeting in my stage 
files by either including a nginx role or omit it, and a cap deploy will do the 
right thing in all three cases and all I had to do was manipulate the role 
assignments on the server objects.  

Once you embrace the concept that roles can be empty it opens up a whole new 
level of flexibility for stage definition. 

I think it's an artificial constraint that has no pros. 

If you don't like empty roles don't define them.  If you inadvertently don't 
populate a role you'll figure it out in short order without cap raising an 
exception. 


On Jul 31, 2012, at 1:40 AM, Lee Hambley  wrote:

> The documentation is almost certainly wrong, there's been a lot of changes to 
> this code from various patches since the docs were written. Unfortunately 
> being in a Wiki we can't take documentation patches along with code patches 
> in the pull requests, and people often forget to update the docs once we mere 
> their pull request. Perhaps you'd like to update them to reflect the current 
> behavior?
> 
> (I can't see a case for running a task with an empty list of servers for a 
> role, Capistrano is a tool for working on remote hosts, if you have a task 
> that doesn't have remote hosts, it's probably a rake task)
> 
> Cheers, Lee
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Failing a deploy/triggering a rollback from callbacks?

2012-07-24 Thread Donovan Bray
If you are in a transaction raise an error

If you are outside a transaction you will have a hard time ensuring everything 
gets rolled back properly. 



On Jul 24, 2012, at 11:28 AM, Chris Patti  wrote:

> Folks;
> 
> I have a function, healcheck() that I wish to call after the deploy
> happens.  I want to somehow fail the deploy and trigger a rollback if
> the health check fails.
> 
> Simply returning false doesn't do it.
> 
> Can anyone please tell me how to make this happen?
> 
> Thanks!
> -Chris
> 
> 
> -- 
> Christopher Patti - Geek At Large | GTalk: cpa...@gmail.com | AIM:
> chrisfeohpatti | P: (260) 54PATTI
> "Technology challenges art, art inspires technology." - John Lasseter, Pixar
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en


Re: [capistrano] Re: How to trigger tasks after deploy:update when running migrations

2012-06-20 Thread Donovan Bray
More oft than not you want to use after 'deploy:update_code' that way you
can sneak in config files n such before the symlink is switched.

But since your trying to notify on a successful deploy 'deploy:update' does
make more sense, but doing it after 'deploy:restart' makes even more sense.

This file is probably the best documentation for capistrano that you'll
ever find.

https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy.rb

On Wed, Jun 20, 2012 at 8:55 PM, Nick Hoffman  wrote:

> Hey Donovan. Yeah, that was the subject of my post, but I went into more
> detail in the body. What I'm trying to do is have a custom task execute
> regardless of whether I'm deploying using "cap production deploy" or "cap
> production deploy:migrations".
>
> Right now, I have this:
> after 'deploy:update', 'notify:email'
>
> Is it necessary to change that from deploy:update to deploy:update_code ?
>
> Thanks,
> Nick
>
>
> On Wednesday, 20 June 2012 21:14:59 UTC-4, dbray wrote:
>>
>> You asked the question: How to trigger tasks after deploy:update when
>> running migrations
>>
>> Which implied to me that you ONLY want to run the extra task when you do
>> a deploy:migrations; and NOT when you do a plain deploy.
>>
>> If you want to do it on any kind of deploy then all you need is:
>>
>> after "deploy:update_code", "the:other:thing"
>>>
>>  --
> * You received this message because you are subscribed to the Google
> Groups "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to
> capistrano+unsubscr...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/capistrano?hl=en
>

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Re: How to trigger tasks after deploy:update when running migrations

2012-06-20 Thread Donovan Bray
You asked the question: How to trigger tasks after deploy:update when running 
migrations

Which implied to me that you ONLY want to run the extra task when you do a 
deploy:migrations; and NOT when you do a plain deploy. 

If you want to do it on any kind of deploy then all you need is:

> after "deploy:update_code", "the:other:thing"

On Jun 20, 2012, at 9:39 AM, Nick Hoffman  wrote:

> Interesting. Thanks for the speedy reply. The "deploy:migrations" task 
> triggers the "deploy:update_code" task, so shouldn't this extra config not be 
> necessary?
> 
> 
> On Wednesday, 20 June 2012 11:24:54 UTC-4, dbray wrote:
> on :start, :only => "deploy:migrations" do
>   after "deploy:update_code", "the:other:thing"
> end
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Re: How to trigger tasks after deploy:update when running migrations

2012-06-20 Thread Donovan Bray
on :start, :only => "deploy:migrations" do
  after "deploy:update_code", "the:other:thing"
end

On Jun 20, 2012, at 7:13 AM, Nick Hoffman  wrote:

> By the way, I'm using v2.12.0
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Change repository dynamically

2012-06-13 Thread Donovan Bray
Try p instead of puts then

On Jun 13, 2012, at 3:38 AM, shrinath_m2  wrote:

> before anyone asks why I want puts and why not "logger.info" or something 
> alike, I have disabled capistrano's detailed logging with my own. 
> That puts few things on screen and few on log files wherever necessary. 
> 
> 
> On Wednesday, June 13, 2012 3:18:01 PM UTC+5:30, shrinath_m2 wrote:
> If I do run_locally, its not outputting my "puts" statements :( 
> What am I missing? 
> 
> 
> 
> On Tuesday, June 12, 2012 9:09:54 PM UTC+5:30, dbray wrote:
> You can make the :both task smarter. 
> 
> task :both do
>   %w(p1 p2).each do  |stage|
>  run_locally "cap #{ARGV.map{|a| a=='both' ? stage : a }.join(' ')}"
>   end
>   exit 0 #don't call any more tasks in this process
> end
> 
> In answer to your second question there's no way to qualify how many things 
> won't be re-evaluated by calling deploy.default in the same process multiple 
> times; the more recipes you use the more chances you have for it to screw 
> you. 
> 
> Off the top of my head I would think you would see this issue if you attempt 
> to set a different deploy_to between stages. 
> 
> On Jun 12, 2012, at 1:50 AM, Shrinath M  wrote:
> 
>> 
>> 
>> On Tue, Jun 12, 2012 at 10:47 AM, Donovan Bray  wrote:
>> with a clean ruby process. 
>> That exactly is my problem - I am passing few custom variables - like "cap 
>> -S config=myconf -S svn_repo=staging -S restart_bin=httpserver task_a" 
>> Now, if I do as you say, I'll have to pass them all over again, which will 
>> re-initiate the whole bootstrapping... Bad, isn't it? That requires lot more 
>> re-structuring...
>> 
>> BTW, what might not work with the accepted approach - deploy.default? 
>> 
>> 
>> 
>> -- 
>> Regards
>> Shrinath M
>> 
>> -- 
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to capistrano@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+unsubscr...@googlegroups.com For more options, visit this group 
>> at http://groups.google.com/group/capistrano?hl=en
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Change repository dynamically

2012-06-13 Thread Donovan Bray
puts I think is a cap helper to upload files

Try

logger.info "blah"

Instead. 

On Jun 13, 2012, at 2:48 AM, shrinath_m2  wrote:

> If I do run_locally, its not outputting my "puts" statements :( 
> What am I missing? 
> 
> 
> 
> On Tuesday, June 12, 2012 9:09:54 PM UTC+5:30, dbray wrote:
> You can make the :both task smarter. 
> 
> task :both do
>   %w(p1 p2).each do  |stage|
>  run_locally "cap #{ARGV.map{|a| a=='both' ? stage : a }.join(' ')}"
>   end
>   exit 0 #don't call any more tasks in this process
> end
> 
> In answer to your second question there's no way to qualify how many things 
> won't be re-evaluated by calling deploy.default in the same process multiple 
> times; the more recipes you use the more chances you have for it to screw 
> you. 
> 
> Off the top of my head I would think you would see this issue if you attempt 
> to set a different deploy_to between stages. 
> 
> On Jun 12, 2012, at 1:50 AM, Shrinath M  wrote:
> 
>> 
>> 
>> On Tue, Jun 12, 2012 at 10:47 AM, Donovan Bray  wrote:
>> with a clean ruby process. 
>> That exactly is my problem - I am passing few custom variables - like "cap 
>> -S config=myconf -S svn_repo=staging -S restart_bin=httpserver task_a" 
>> Now, if I do as you say, I'll have to pass them all over again, which will 
>> re-initiate the whole bootstrapping... Bad, isn't it? That requires lot more 
>> re-structuring...
>> 
>> BTW, what might not work with the accepted approach - deploy.default? 
>> 
>> 
>> 
>> -- 
>> Regards
>> Shrinath M
>> 
>> -- 
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to capistrano@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+unsubscr...@googlegroups.com For more options, visit this group 
>> at http://groups.google.com/group/capistrano?hl=en
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Change repository dynamically

2012-06-12 Thread Donovan Bray
And you've hit exactly what I warned you about; and it wont likely be your 
last. 

On Jun 12, 2012, at 8:03 AM, shrinath_m2  wrote:

> OK, now I am stuck in something interesting...
> 
> My logic to achieve the above said requirement is as follows: 
> 
> You call "cap -S config=blah -S svn-repo=both my_deploy"
> 
> The code in deploy.rb is as such: 
> 
>   
> task :my_deploy do
>   init_server_list { deploy.default } 
> end
> 
> def init_server_list(&given_task)
> 
>   # if svn repo name is given, get ip from there. 
>   if variables.include?(:svn_repo) and svn_repo == "both"
> # get all repo names, call deployer for every unique name.  
> con = Mysql.new(db_host, db_user, db_pass, db_schema)
> rs = con.query("SELECT DISTINCT _nick_name FROM repo;")
> rs.each do |row|
>   set :repo_name, row[0]
>   get_server_list given_task
> end
> con.close
>   end
> end
> 
> 
> def get_server_list(action)
>   con = Mysql.new(db_host, db_user, db_pass, db_schema)
>   query = "select 
>   server.`_ip` as ip,
>   repo.`_svn_url` as repo_url
> from
>   server 
>   left join repo
> on repo.`_id` = server.`_repo_id`
> where repo.`_nick_name` = '#{repo_name}'";
> 
>   rs = con.query(query)  
>   roles[:app].clear
> 
>   rs.each do |row|
> role :app, row[0]
> set :repository, row[1]
>   end
>   con.close
>   action.call
> end
> 
> # Unnecessary code removed and/or obfuscated, but assure that no harm done to 
> hinder debugging. 
> 
> Now the logic is that it should loop through for every repository, get the 
> list of servers to be updated for that repository and update the code. 
> All is well, it runs smoothly for every server and all... But...
> When it comes to updating the svn repo, it is pushing the same repo that it 
> got first time. 
> It seemed that the "svn checkout" command is cached somewhere...
> 
> Further debugging, I went into "strategy/checkout.rb" inside capistrano's 
> code. 
> 
> def command
>   @command || = source.checkout(revision, configuration[:release_path])
> end
> 
> Remove the '||' there, it works well... I wouldn't like to touch original 
> capistrano code unless absolutely necessary. So, is there a way to unset the 
> command variable from my recipe or any better way? 
> Any suggestions towards the architecture or a solution would be welcome... 
> 
> 
> 
> On Tuesday, June 12, 2012 2:20:46 PM UTC+5:30, shrinath_m2 wrote:
> 
> 
> On Tue, Jun 12, 2012 at 10:47 AM, Donovan Bray  wrote:
> with a clean ruby process. 
> That exactly is my problem - I am passing few custom variables - like "cap -S 
> config=myconf -S svn_repo=staging -S restart_bin=httpserver task_a" 
> Now, if I do as you say, I'll have to pass them all over again, which will 
> re-initiate the whole bootstrapping... Bad, isn't it? That requires lot more 
> re-structuring...
> 
> BTW, what might not work with the accepted approach - deploy.default? 
> 
> 
> 
> -- 
> Regards
> Shrinath M
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Change repository dynamically

2012-06-12 Thread Donovan Bray
You can make the :both task smarter. 

task :both do
  %w(p1 p2).each do  |stage|
 run_locally "cap #{ARGV.map{|a| a=='both' ? stage : a }.join(' ')}"
  end
  exit 0 #don't call any more tasks in this process
end

In answer to your second question there's no way to qualify how many things 
won't be re-evaluated by calling deploy.default in the same process multiple 
times; the more recipes you use the more chances you have for it to screw you. 

Off the top of my head I would think you would see this issue if you attempt to 
set a different deploy_to between stages. 

On Jun 12, 2012, at 1:50 AM, Shrinath M  wrote:

> 
> 
> On Tue, Jun 12, 2012 at 10:47 AM, Donovan Bray  wrote:
> with a clean ruby process. 
> That exactly is my problem - I am passing few custom variables - like "cap -S 
> config=myconf -S svn_repo=staging -S restart_bin=httpserver task_a" 
> Now, if I do as you say, I'll have to pass them all over again, which will 
> re-initiate the whole bootstrapping... Bad, isn't it? That requires lot more 
> re-structuring...
> 
> BTW, what might not work with the accepted approach - deploy.default? 
> 
> 
> 
> -- 
> Regards
> Shrinath M
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Is there a way to identify requested task from within the recipe?

2012-06-12 Thread Donovan Bray
Not sure exactly what you are after but you may be able to do what you want by 
only executing the code (or adding more hooks) on start of the invocation of 
the tasks from the command line. 

Ie:

on :start, :only => [:deploy, "my:custom:task"] do
  the.thing.i.want.to.do.in.this.case
  # and/or
  after "deploy:update_code","this:other:thing"
end

In the case above "this:other:thing" would only run during a basic deploy OR if 
"my:custom:task" was passed on the command line. 

Note that it won't run if you did

cap deploy:migrations

Because :deploy in the array only matches 'deploy'; if you wanted it to run 
then you also have to specify "deploy:migrations" in the array passed via the 
implicit hash. 

There is an internal call stack that you might be able to abuse; but I prefer 
the declarative nature of using on :start

I try to keep capistrano magic out of the tasks themselves. 

On Jun 12, 2012, at 12:11 AM, shrinath_m2  wrote:

> Assume I run "cap -S blah=bar my_custom_task"
> 
> Assume the following code in the recipe: 
> 
> task :my_custom_task do
>   task2
> end
> 
> task :task2 do
>   # I want to know the name of the requested task (my_custom_task) here...
> end
> 
> Possible? 
> 
> In real scenario, I want to know if deploy was called or any of my custom 
> tasks were called. 
> 
> Thanks, 
> Shrinath M
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Change repository dynamically

2012-06-11 Thread Donovan Bray
It may appear to work at first glance but you'll be surprised what doesn't get 
re-evaluated the second time you call deploy.default in the same process. 

The method I described to you starts the each underlying deploy with a clean 
ruby process. 


On Jun 11, 2012, at 5:05 AM, Shrinath M  wrote:

> Good! That "deploy.default" works... 
> May be I should have learn't a bit of ruby, rake and things before dropping 
> right in...
> 
> Thanks :)
> 
> On Mon, Jun 11, 2012 at 2:48 PM, Rafa García  wrote:
> Try with the task "deploy.default" (when you do "deploy" you're calling 
> "deploy:default").
> 
> If you're inside of a namespace "top.deploy.default" , it goes to top parent 
> namespace and look for deploy:default.
> 
> Regards
> 
> 
> 2012/6/11 shrinath_m2 
> Tried that, but there is a problem - calling the "run_locally 'cap deploy'" 
> does all the initialization from beginning... I don't really want that - 
> isn't there a way to call "deploy" as a task or something? Like so: 
> 
> task :a1 do
>   a2
> end
> 
> task :a2 do
>   deploy #calls the default deploy?
> end
> 
> I should be doing cap -S whatever=wherever a1 and thus starting the 
> deployment. 
> 
> I tried the above, but having "deploy" in a task doesn't seem to be doing 
> anything :(
> 
> 
> On Saturday, June 9, 2012 7:26:57 AM UTC+5:30, dbray wrote:
> It's hacky but I've done something like this before: I call this pattern 
> cannibalistic capistrano. 
> 
> task :p1 do
>   set :repository, 'xyz'
>   server 
> end
> 
> task :p2 do
>   set :repository, 'abc'
>   server 
> end
> 
> task :both do
>   namespace :deploy do
> task :default do; end
>   end
>   %w(p1 p2).each do  |stage|
>  run_locally "cap #{stage} deploy"
>   end
> end
> 
> You should be able to do any of the following:
> 
> cap p1 deploy
> cap p2 deploy
> cap both deploy
> 
> On Jun 8, 2012, at 8:52 AM, Shrinath M  wrote:
> 
>> And how would I do that? 
>> Make a custom task and call deploy twice in it with different repo settings? 
>> 
>> On Fri, Jun 8, 2012 at 8:25 PM, Donovan Bray  wrote:
>> My first reaction is that you will have to do two deploys ie in two stages 
>> one for each repo. 
>> 
>> On Jun 7, 2012, at 11:30 PM, shrinath_m2  wrote:
>> 
>>> Hi all, 
>>> 
>>> I have a specific requirement: 
>>> 
>>> We have 10 machines on which specific codes are deployed. 
>>> Codes are in SVN. 
>>> Out of those 10, we sometimes want 1 or 2 of the machines to point to a 
>>> different SVN repo/path. 
>>> I have all the server IPs in mysql, I fetch them into my recipe using 
>>> queries to db, then loop and add them to role :app. 
>>> Now with the above mentioned requirements, I thought of adding SVN repo URL 
>>> to the mysql too, so that every IP has the associated SVN URL that shall be 
>>> deployed to it. 
>>> 
>>> Now how do I switch repo dynamically in deployment procedure? 
>>> Any suggestions welcome. 
>>> 
>>> Regards, 
>>> Shrinath M
>>> -- 
>>> * You received this message because you are subscribed to the Google Groups 
>>> "Capistrano" group.
>>> * To post to this group, send email to capistrano@googlegroups.com
>>> * To unsubscribe from this group, send email to 
>>> capistrano+unsubscr...@googlegroups.com For more options, visit this group 
>>> at http://groups.google.com/group/capistrano?hl=en
>> 
>> -- 
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to capistrano@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+unsubscr...@googlegroups.com For more options, visit this group 
>> at http://groups.google.com/group/capistrano?hl=en
>> 
>> 
>> 
>> -- 
>> Regards
>> Shrinath M
>> 
>> -- 
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to capistrano@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+unsubscr...@googlegroups.com For more options, visit this group 
>> at http://groups.google.com/group/capistrano?hl=en
> 
> -- 
> * You received this message because you are subscribed

Re: [capistrano] Change repository dynamically

2012-06-08 Thread Donovan Bray
It's hacky but I've done something like this before: I call this pattern 
cannibalistic capistrano. 

task :p1 do
  set :repository, 'xyz'
  server 
end

task :p2 do
  set :repository, 'abc'
  server 
end

task :both do
  namespace :deploy do
task :default do; end
  end
  %w(p1 p2).each do  |stage|
 run_locally "cap #{stage} deploy"
  end
end

You should be able to do any of the following:

cap p1 deploy
cap p2 deploy
cap both deploy

On Jun 8, 2012, at 8:52 AM, Shrinath M  wrote:

> And how would I do that? 
> Make a custom task and call deploy twice in it with different repo settings? 
> 
> On Fri, Jun 8, 2012 at 8:25 PM, Donovan Bray  wrote:
> My first reaction is that you will have to do two deploys ie in two stages 
> one for each repo. 
> 
> On Jun 7, 2012, at 11:30 PM, shrinath_m2  wrote:
> 
>> Hi all, 
>> 
>> I have a specific requirement: 
>> 
>> We have 10 machines on which specific codes are deployed. 
>> Codes are in SVN. 
>> Out of those 10, we sometimes want 1 or 2 of the machines to point to a 
>> different SVN repo/path. 
>> I have all the server IPs in mysql, I fetch them into my recipe using 
>> queries to db, then loop and add them to role :app. 
>> Now with the above mentioned requirements, I thought of adding SVN repo URL 
>> to the mysql too, so that every IP has the associated SVN URL that shall be 
>> deployed to it. 
>> 
>> Now how do I switch repo dynamically in deployment procedure? 
>> Any suggestions welcome. 
>> 
>> Regards, 
>> Shrinath M
>> -- 
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to capistrano@googlegroups.com
>> * To unsubscribe from this group, send email to 
>> capistrano+unsubscr...@googlegroups.com For more options, visit this group 
>> at http://groups.google.com/group/capistrano?hl=en
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en
> 
> 
> 
> -- 
> Regards
> Shrinath M
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Change repository dynamically

2012-06-08 Thread Donovan Bray
My first reaction is that you will have to do two deploys ie in two stages one 
for each repo. 

On Jun 7, 2012, at 11:30 PM, shrinath_m2  wrote:

> Hi all, 
> 
> I have a specific requirement: 
> 
> We have 10 machines on which specific codes are deployed. 
> Codes are in SVN. 
> Out of those 10, we sometimes want 1 or 2 of the machines to point to a 
> different SVN repo/path. 
> I have all the server IPs in mysql, I fetch them into my recipe using queries 
> to db, then loop and add them to role :app. 
> Now with the above mentioned requirements, I thought of adding SVN repo URL 
> to the mysql too, so that every IP has the associated SVN URL that shall be 
> deployed to it. 
> 
> Now how do I switch repo dynamically in deployment procedure? 
> Any suggestions welcome. 
> 
> Regards, 
> Shrinath M
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Re: [capistrano] Deploying to self-same server

2012-06-07 Thread Donovan Bray
I don't see how it's misused; ssh is ssh whether your doing it to localhost or 
otherwise it requires no particular support from capistrano.  In both cases you 
only need to ensure that your ssh client and server are properly configured. 

That's the beauty of capistrano being built in ruby; you are free to make the 
necessary changes to support your core concept. If that isn't what I want out 
of capistrano I'm free to monkey patch it.  

As much as I'm a proponent for bending cap where it makes sense; I'm also your 
biggest supporter of making capistrano narrowly focused on delivering a 
reliable deployment system. The inspired architecture and openness to be 
extended will continue to allow me to use it for provisioning. You shouldn't be 
shackled by anything outside your core concept, I say change what you must and 
be brutal about adhering to your core concept. 

On Jun 7, 2012, at 12:48 AM, Lee Hambley  wrote:

> > I have a much more liberal view I guess of what capistrano can be leveraged 
> > for. If you know you have to build a deployment tool to reach remote 
> > servers; and deploying to localhost allows you to test that pattern before 
> > you pay for that server then by all means do it with cap. 
> 
> I'd say misused, additional use cases outside of the intended make it 
> increasingly difficult for me to change anything, because I am then breaking 
> mis-features, and mis-uses of the library; but in open source that's not 
> something one can ever prevent.
> 
> > However I agree many maintenance tasks are written directly in cap when 
> > they should be written in rake.
> 
> I'm seriously considering adding a `rake()` command, that's effectively 
> `run("#{rake} #{task}")` - to encourage this technique, and make it seem more 
> like someone actually thought about it.
> 
> - Lee
> 
> On 7 June 2012 03:34, Donovan Bray  wrote:
> I have a much more liberal view I guess of what capistrano can be leveraged 
> for. If you know you have to build a deployment tool to reach remote servers; 
> and deploying to localhost allows you to test that pattern before you pay for 
> that server then by all means do it with cap. 
> 
> However I agree many maintenance tasks are written directly in cap when they 
> should be written in rake. I create a rake cmd wrapper that I use in those 
> situations so I can easily call the rake task from cap just as easily as I 
> could run rake directly on the server via the console.  If you ONLY have 
> those tasks in cap then that is a deployment smell. 
> 
> Always leave yourself options. 
> 
> 
> On Jun 6, 2012, at 8:40 AM, Lee Hambley  wrote:
> 
>> Donovan,
>> 
>> Kudos for giving a longer answer, but when you are "deploying" to a local 
>> server, what you are really doing is building the app, deploying, sort of by 
>> definition is getting something from somewhere, and putting it somewhere 
>> else…
>> 
>> I'd argue rake is the correct tool for a *lot* of what people misuse 
>> capistrano for; and particularly in this case, Rake fits the bill perfectly 
>> for building/releasing when everything is in one place.
>> 
>> - Lee
>> On Wednesday, June 6, 2012 at 5:38 PM, Donovan Bray wrote:
>> 
>>> Possibly if you override the sudo, run, and make them call run_locally
>>> 
>>> That being said I've deployed to localhost by setting up a specific key for 
>>> the deploy user, and it worked fine and preserved the ability to deploy to 
>>> stages that weren't localhost. 
>>> 
>>> What's so bad about ssh'ing to itself?
>>> 
>>> Other ideas can be found here
>>> 
>>> http://stackoverflow.com/questions/8692664/how-do-i-execute-a-capistrano-task-locally
>>> 
>>> On Jun 6, 2012, at 7:48 AM, jdgriffith  
>>> wrote:
>>> 
>>>> I am curious about using capistrano to deploy to the selfsame server on 
>>>> which the recipe lives on without doing an ssh connection since it is not 
>>>> needed. Is this something capistrano can do easily or is it mostly used 
>>>> for remote deployments?
>>>> 
>>>> Regards,
>>>> Jdgriffith
>>>> -- 
>>>> * You received this message because you are subscribed to the Google 
>>>> Groups "Capistrano" group.
>>>> * To post to this group, send email to capistrano@googlegroups.com
>>>> * To unsubscribe from this group, send email to 
>>>> capistrano+unsubscr...@googlegroups.com For more options, visit this group 
>>>> at http://groups.google.com/g

  1   2   3   >