Comments on: Advanced Capistrano usage https://kpumuk.info/development/advanced-capistrano-usage/ In my blog I'll try to describe about interesting technologies, my discovery in IT and some useful things about programming. Wed, 10 Jul 2013 20:55:15 +0000 hourly 1 https://wordpress.org/?v=6.5.5 By: Bash https://kpumuk.info/development/advanced-capistrano-usage/comment-page-1/#comment-370400 Wed, 10 Jul 2013 20:55:15 +0000 http://kpumuk.info/?p=1205#comment-370400 Thank you very much for item #5 – generating server lists on the fly. This was a huge help to me!

The only change I needed to make was to add :web role node creation inside the loop that already creates :app nodes.

]]>
By: Dmytro Shteflyuk https://kpumuk.info/development/advanced-capistrano-usage/comment-page-1/#comment-296626 Fri, 04 Nov 2011 15:10:45 +0000 http://kpumuk.info/?p=1205#comment-296626 In reply to michael.

There is no reason to fail if the file is not exists. It is not a failure situation, so it’s totally ok to treat both missing file and empty file as no-lock.

]]>
By: michael https://kpumuk.info/development/advanced-capistrano-usage/comment-page-1/#comment-294548 Wed, 14 Sep 2011 03:08:23 +0000 http://kpumuk.info/?p=1205#comment-294548
1
data = capture("cat #{shared_path}/system/lock.txt 2>/dev/null;echo").to_s.strip

That is a dirty line of code – I think you want to check if the file exists first, and do an exit 1; at the end. Something similar to this:

1
data = capture("if [ -f #{shared_path}/system/lock.txt ]; then cat #{shared_path}/system/lock.txt; else exit 1;fi")

I have not tested, but that should get you just about what you were going for.

]]>