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

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

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) == :produc

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 var

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/maste

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 o

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

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

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{Ca

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, 2

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

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:

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 :a

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

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.

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

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? Que

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

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

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 ma

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 s

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

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 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 onl

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 yo

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' >

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 m

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 > >

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

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 allowe

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.

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 wi

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 an

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

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 pr

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 i

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 tas

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 independen

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 execut

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 p

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 examp

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).

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 i

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

2013-02-14 Thread Donovan Bray
mprovement 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, 2

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 stackoverf

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

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:

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. >

[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 pre

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

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

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

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.

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, t

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

Re: [capistrano] tasks being executed on unexpected servers

2013-01-29 Thread Donovan Bray
his 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] &

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, :ro

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

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 i

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-

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

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 t

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

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 > release

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 doin

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 y

Re: [capistrano] precompile assets task, roles

2012-12-05 Thread Donovan Bray
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

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,

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

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

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 f

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

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

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

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: > > 201

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 direc

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

Re: [capistrano] Re: Deploy not updating site

2012-08-21 Thread Donovan Bray
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: >&

Re: [capistrano] Re: Deploy not updating site

2012-08-21 Thread Donovan Bray
ist.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. >&g

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, e

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

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 wi

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

2012-07-31 Thread Donovan Bray
u'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 f

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" gro

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 as

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 jenk

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

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.

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 f

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 "

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 t

Re: [capistrano] Change repository dynamically

2012-06-13 Thread Donovan Bray
ould 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. >> Tha

Re: [capistrano] Change repository dynamically

2012-06-13 Thread Donovan Bray
> > 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: >&g

Re: [capistrano] Change repository dynamically

2012-06-12 Thread Donovan Bray
ide 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,

Re: [capistrano] Change repository dynamically

2012-06-12 Thread Donovan Bray
ploy_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=

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

Re: [capistrano] Change repository dynamically

2012-06-11 Thread Donovan Bray
; 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 > e

Re: [capistrano] Change repository dynamically

2012-06-08 Thread Donovan Bray
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:

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,

Re: [capistrano] Deploying to self-same server

2012-06-07 Thread Donovan Bray
;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 leverage

  1   2   3   >