[Capistrano] Re: building custom config files...

2009-03-04 Thread Gerhardus Geldenhuis
Hi Peter, On Mar 3, 5:39 pm, Peter Booth pbo...@nocoincidences.com wrote: Gerhardus, On Mar 2, 2009, at 11:46 AM, Gerhardus Geldenhuis wrote: Hi Peter, I already use the multistage gem which works very well for us. multistage is excellent at providing a structure for stage-specific

[Capistrano] a suggestion idea

2009-03-03 Thread Gerhardus Geldenhuis
Hi It would be nice to have something like the following: namespace config task :copyconfig, :roles = appservers do_something end task :copyconfig, :roles = dbservers do_something end end the idea being that if you call config.copyconfig it will get called twice but for each

[Capistrano] building custom config files...

2009-03-02 Thread Gerhardus Geldenhuis
Hi I want to create custom config files and would appreciate any tips if anyone has attempted the same thing. I am planning to do it in the following way: Download the config files using run command with svn insert and append the config files using the run command with sed and awk based on the

[Capistrano] Re: building custom config files...

2009-03-02 Thread Gerhardus Geldenhuis
     }    monit_config end On Mar 2, 2009, at 9:50 AM, Gerhardus Geldenhuis wrote: Hi I want to create custom config files and would appreciate any tips if anyone has attempted the same thing. I am planning to do it in the following way: Download the config files using run

[Capistrano] Re: Capistrano maintainership

2009-02-26 Thread Gerhardus Geldenhuis
Hi I am just glad someone is willing to step in so quickly. I think capistrano and webistrano is both great products but with an original focus on ruby/rails applications. I believe that with a bit of effort ( a bit more in webistrano) it could easily be made to be more generic. Currently I have

[Capistrano] writing a preflightcheck task

2009-02-20 Thread Gerhardus Geldenhuis
Hi Version 1 task :check_lb_worker_exists, :roles = :apacluster, :on_error = :abort do if exists?(:modjk_loadbalancerworker) then begin run if wget #{wgetparams} 'http://$CAPISTRANO:HOST$/jkserver- status?cmd=editfrom=listw=#{modjk_loadbalancerworker}' | grep 'ERROR'; then

[Capistrano] Re: writing a preflightcheck task

2009-02-20 Thread Gerhardus Geldenhuis
a begin/rescue clause, instead of an unless condition.   begin     some.task   rescue Exception = e     puts got exception: #{e}   end Does that make sense? Exceptions bypass your program logic and require explicit handling. - Jamis On 2/20/09 9:28 AM, Gerhardus Geldenhuis wrote

[Capistrano] logger vs puts

2009-02-20 Thread Gerhardus Geldenhuis
Hi Is it recommended to use logger.info or should I rather be using puts? Also is there options other than logger.info and I would appreciate it if you could point me to the source code for logger which would probably answer my second question. Best Regards

[Capistrano] Re: logger vs puts

2009-02-20 Thread Gerhardus Geldenhuis
/09 11:00 AM, Gerhardus Geldenhuis wrote: Hi Is it recommended to use logger.info or should I rather be using puts? Also is there options other than logger.info and I would appreciate it if you could point me to the source code for logger which would probably answer my second question

[Capistrano] Re: raising exeptions

2009-02-17 Thread Gerhardus Geldenhuis
Found a good solution: unless exists?(:app_path) abort I failed end On Feb 17, 10:58 am, Gerhardus Geldenhuis gerhardus.geldenh...@gmail.com wrote: Hi I assumed that if I purposely raised an exception it would show my error message and stop. Capistrano/ruby does

[Capistrano] raising exeptions

2009-02-17 Thread Gerhardus Geldenhuis
Hi I assumed that if I purposely raised an exception it would show my error message and stop. Capistrano/ruby does that but it also included a whole bunch of other items that would confuse my users. deploy-config.rb:92:in `load': I failed (RuntimeError) from

[Capistrano] staggered deploy revisited

2009-02-16 Thread Gerhardus Geldenhuis
Hi I have managed to confuse myself again... I am trying to do the following: my staggered deploy scripts cycles through a list of application servers doing the following: disable app server on multiple load balancers install new app enable app server on multiple load balancers continue on to

[Capistrano] Re: staggered deploy revisited

2009-02-16 Thread Gerhardus Geldenhuis
On 2/16/09 5:09 AM, Gerhardus Geldenhuis wrote: I have also put the relevant code onhttp://pastie.org/390600 Regards --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to capistrano-unsubscr...@googlegroups.com For more options, visit this group

[Capistrano] Re: staggered deploy revisited

2009-02-16 Thread Gerhardus Geldenhuis
/dev/null maybe a wrapper to allow easier/simplified http interaction with put and get might be usefull. (perhaps even some xml manipulation) Anyway just some random thoughts. Regards On Feb 16, 3:44 pm, Jamis Buck ja...@37signals.com wrote: On 2/16/09 8:37 AM, Gerhardus Geldenhuis wrote

[Capistrano] Checking for variable existence

2009-02-13 Thread Gerhardus Geldenhuis
Hi I vaguely recall seeing a way to test for empty or non-existent variables but could not find it going through my archives. I want to know if there is a way to test whether a variable has been declared/have a value? Basically I want to write a pre-flight check program that checks that users

[Capistrano] Re: Checking for variable existence

2009-02-13 Thread Gerhardus Geldenhuis
: See the #exists?(:var) method:  http://wiki.capify.org/article/Exists%3F Hope that helps, Jamis On 2/13/09 7:29 AM, Gerhardus Geldenhuis wrote: Hi I vaguely recall seeing a way to test for empty or non-existent variables but could not find it going through my archives. I want

[Capistrano] Caching in Capistrano

2009-02-13 Thread Gerhardus Geldenhuis
Hi is any caching that capistrano does only for the duration of a running cap command? I have seen some weird errors which I thought might potentially caching related. Basically I thing this variable was not being set $CAPISTRANO:HOST$ properly which caused some of the tasks to not work

[Capistrano] Re: Staggered Install

2009-01-30 Thread Gerhardus Geldenhuis
:31 pm, Jamis Buck ja...@37signals.com wrote: find_servers(:roles = :foo).each do |server|   run disable server on load balancer, :host = server   run install new software, :host = server   run test server, :host = server   # etc. end - Jamis On 1/28/09 8:16 AM, Gerhardus Geldenhuis wrote

[Capistrano] Re: Staggered Install

2009-01-30 Thread Gerhardus Geldenhuis
On 1/30/09 7:51 AM, Gerhardus Geldenhuis wrote: True, But I do need multistage to deploy to different stages eg production, test, demo, load-test etc. I have also defined stages for different application stacks in production for example. eg prod-app1, prod-app2 We need to deploy our

[Capistrano] Re: :on_error = :abort custom message

2009-01-29 Thread Gerhardus Geldenhuis
recommendation is to put the command in a script and execute the script on the server, e.g.:   put some big long command to execute, /tmp/script.sh   run sh -c /tmp/script.sh - Jamis On 1/28/09 10:29 AM, Gerhardus Geldenhuis wrote: Thanks Lee, That will certainly be usefull and solve some

[Capistrano] Re: :on_error = :abort custom message

2009-01-29 Thread Gerhardus Geldenhuis
On 1/29/09 5:33 AM, Gerhardus Geldenhuis wrote: Thanks, that was my second option to create a script on the local box, however I like the clean approach of keeping all the logic on the deployment box which means I don't have to worry about any deployment requirements. Would the abbility

[Capistrano] Re: Editor for Capistrano

2009-01-28 Thread Gerhardus Geldenhuis
are just pure ruby. - Lee 2009/1/27 Gerhardus Geldenhuis gerhardus.geldenh...@gmail.com Hi I am looking at Ruby editors available and was wondering if anyone has a favourite editor they want to recommend for capistrano or that can be adapted to work well with capistrano. A colleague

[Capistrano] Re: Editor for Capistrano

2009-01-28 Thread Gerhardus Geldenhuis
of code where it was declared even if it weren't part of my application which was powerfull and an excellent way to learn. Regards On Jan 28, 10:04 am, Gerhardus Geldenhuis gerhardus.geldenh...@gmail.com wrote: Hi Thanks for the replies, I am not yet ready to give up on vi/vim but thought

[Capistrano] path problems

2009-01-28 Thread Gerhardus Geldenhuis
Hi I have created the following alias for a deployer user: alias capg='cap -f /home/deployer/tomcat-deploy/multistage/ testingmultstage.rb' however when the user runs capg he/she gets the following error: /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.3/lib/capistrano/

[Capistrano] Re: path problems

2009-01-28 Thread Gerhardus Geldenhuis
://www.ruby-doc.org/core/classes/File.html#M002565 . - Hope this helps. 2009/1/28 Gerhardus Geldenhuis gerhardus.geldenh...@gmail.com Hi I have created the following alias for a deployer user: alias capg='cap -f /home/deployer/tomcat-deploy/multistage/ testingmultstage.rb

[Capistrano] Staggered Install

2009-01-28 Thread Gerhardus Geldenhuis
Hi I need to do something like the following: for server in role do Disable server on load balancer Install new software Test Server Enable server in load balancer If successful then deploy next server else fail/rollback. done The individual steps is not a problem but I am unsure how

[Capistrano] Re: Staggered Install

2009-01-28 Thread Gerhardus Geldenhuis
test server, :host = server   # etc. end - Jamis On 1/28/09 8:16 AM, Gerhardus Geldenhuis wrote: Hi I need to do something like the following: for server in role do   Disable server on load balancer   Install new software   Test Server   Enable server in load balancer

[Capistrano] Editor for Capistrano

2009-01-27 Thread Gerhardus Geldenhuis
Hi I am looking at Ruby editors available and was wondering if anyone has a favourite editor they want to recommend for capistrano or that can be adapted to work well with capistrano. A colleague is using Komodo which is commercial but looks quite nice. atm I am using vim which has so far been

[Capistrano] Multistage in capistrano

2009-01-23 Thread Gerhardus Geldenhuis
Hi I have been doing some reading about how to implement multistaging but I am not sure which route I should be following. I would really appreciate some advice/thoughts. I have found Multistage: http://weblog.jamisbuck.org/2007/7/23/capistrano-multistage and another possible method

[Capistrano] Prettifying task and logging

2009-01-23 Thread Gerhardus Geldenhuis
Hi Is there a way to display a string rather than the command executed with run in a task. Some of my run commands are quite involved and does not look very intuitive or clear on the screen. I would rather show the operator a simple output with a log file somewhere else that stores all the

[Capistrano] Re: Multistage in capistrano

2009-01-23 Thread Gerhardus Geldenhuis
Hi am reading through the archives at the moment and am missing some good examples of how to actually use multistage. I realized that I have no idea what to do further other defining my stages. Regards On Jan 23, 3:12 pm, Gerhardus Geldenhuis gerhardus.geldenh...@gmail.com wrote: Hi I have

[Capistrano] Re: Multistage in capistrano

2009-01-23 Thread Gerhardus Geldenhuis
: Hi Gerhardus,   Where are you upto so far? - Lee 2009/1/23 Gerhardus Geldenhuis gerhardus.geldenh...@gmail.com Hi am reading through the archives at the moment and am missing some good examples of how to actually use multistage. I realized that I have no idea what to do further

[Capistrano] Re: exit status and task success

2009-01-22 Thread Gerhardus Geldenhuis
except exit with a status code of 1.) - Jamis On 1/21/09 10:42 AM, Rafael G. wrote: Gerhardus Geldenhuis wrote: Hi Is there a way to run different tasks based on the exit status of a run command? Also how can I force a task to fail or succeed, how is the failure/success of a task

[Capistrano] Capistrano vs Puppet

2009-01-22 Thread Gerhardus Geldenhuis
Hi vs might be a bit of a controversial term. I am really interested in peoples opinions about the overlapping or symbiotic relationship between capistrano and puppet. If you are using both tools, could you expand on the relationship between the tools in your usage of them? I have some thoughts

[Capistrano] RFC on script

2009-01-22 Thread Gerhardus Geldenhuis
Hi I have written the following script to monitor succesfull startup of our webapp: I am trying every second to get a webpage but also have a timeout which will fail the task after 60 seconds. task :monitor_app_startup, :roles = :testct do run -CMD for ((n=0; n61; n++ )); do if wget

[Capistrano] Re: RFC on script

2009-01-22 Thread Gerhardus Geldenhuis
maculike2:~ mbailey$ if wget --tries=1 --wait=1 --connect-timeout=1 --timeout=1 --quiethttp://www.google.com/;then echo 'success'; else echo 'fail'; fi; success On Fri, Jan 23, 2009 at 2:13 AM, Gerhardus Geldenhuis gerhardus.geldenh...@gmail.com wrote: Hi I have written the following

[Capistrano] Re: RFC on script

2009-01-22 Thread Gerhardus Geldenhuis
Thanks, I need to configure wget that it does not try 60 times in one second but that is just some man page reading. My confusions were that I was assuming that capistrano would handle exit 1 statements and not fail completely. Regards On Jan 22, 3:56 pm, Mike Bailey m...@bailey.net.au wrote:

[Capistrano] Re: exit status and task success

2009-01-22 Thread Gerhardus Geldenhuis
On Jan 22, 4:08 pm, Jamis Buck ja...@37signals.com wrote: The run() command does not return success/failure. If it succeeds, it returns. If it fails, it raises an exception. To get the result of a command, you can use the capture() method:  http://wiki.capify.org/article/Capture Note,

[Capistrano] Re: How to deploy to a single specific server using Capistrano

2009-01-22 Thread Gerhardus Geldenhuis
capistrano. Regards On Jan 22, 4:14 pm, Jamis Buck ja...@37signals.com wrote: On 1/22/09 4:12 AM, Gerhardus Geldenhuis wrote: I have found this very usefull, however I do not understand the difference between HOSTS and HOSTFILTER. It would be great if you could explain it from another angle

[Capistrano] Re: RFC on script

2009-01-22 Thread Gerhardus Geldenhuis
Hi This is not really capistrano related anymore but I thought it worthwhile to mention for anyone following the thread. I have tried a number of wget flags: wget longtct03g:8080/gta/buildInfo.jsp -O - --connect-timeout=1 -- timeout=1 --tries=60 --wait=1 --waitretry=10 --retry-connrefused

[Capistrano] role/host variable

2009-01-21 Thread Gerhardus Geldenhuis
Hi Is there a variable that I can access to get the name of each server in the role? I want to do something like the following: task :idfile, :roles = :testtct do run touch /tmp/#{testtct.name} end Regards --~--~-~--~~~---~--~~ To unsubscribe from this

[Capistrano] exit status and task success

2009-01-21 Thread Gerhardus Geldenhuis
Hi Is there a way to run different tasks based on the exit status of a run command? Also how can I force a task to fail or succeed, how is the failure/success of a task determined/defined. Regards --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to

[Capistrano] CLI.ui.ask does not prompt

2009-01-19 Thread Gerhardus Geldenhuis
Hi I can't get the following code snippet to work. task :promptme, :roles = :gg do set(:user) { Capistrano::CLI.ui.ask(User name: ) } end I expected it to prompt me on the command line when running cap promptme but it does not prompt me at all. cap promptme * executing `promptme' When

[Capistrano] problem with cat /etc/passwd do |ch, stream, data|

2009-01-15 Thread Gerhardus Geldenhuis
Hi I saw the following code on http://blog.innerewut.de/2007/9/28/capturing-output-in-capistrano and thought it was capistrano run cat /etc/passwd do |ch, stream, data| if stream == :err logger.debug capured output on STDERR: #{data} else # stream == :out logger.debug capured

[Capistrano] Waiting for tasks and tailing files

2009-01-14 Thread Gerhardus Geldenhuis
Hi I am writing a task that undeploys our application in tomcat. Normally if we do it by hand we remove the war file and then watch the tomcat webapp directory for the automatic deletion of the application directory. I would appreciate advice on the best way to achieve something similar like

[Capistrano] is if cpu x part of capistrano

2009-01-08 Thread Gerhardus Geldenhuis
Hi I have emailed this from my gmail account earlier but did not see the message appear on the group. Apologies if it is double posted. I have been going through same of the example scripts on the mailing list page and came acrross this. Its just an extract from:

[Capistrano] Re: is if cpu x part of capistrano

2009-01-08 Thread Gerhardus Geldenhuis
in this context. This is not part of Capistrano but is a Monit configuration file. Monit is a process level monitoring tool that can react to resource consumption. Jonathan -- Jonathan Weiss http://blog.innerewut.de http://twitter.com/jweiss -- Gerhardus Geldenhuis Registered Linux User