how to access the release variable?

34 views
Skip to first unread message

deadb...@gmail.com

unread,
Feb 25, 2015, 1:38:36 PM2/25/15
to capis...@googlegroups.com

If release_path = /Deploy/nrpe/releases/20150225183149

Is there a variable to access the 20150225183149 part?  Or some other method?



Thank you

Lee Hambley

unread,
Feb 25, 2015, 1:50:15 PM2/25/15
to 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+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/3d2e61f8-8040-481f-ab30-53c9cfaab13a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

deadb...@gmail.com

unread,
Feb 25, 2015, 2:12:11 PM2/25/15
to capis...@googlegroups.com

Sorry my brain was thinking config/deploy.rb and not shell.  

If I was in a shell I could do

var=` basename /var/www/app/release/201501222`
echo $var

I'm not sure how to assign the output of a command to a variable within config/deploy.rb that can then be later included in an execute command.

--d

Lee Hambley

unread,
Feb 25, 2015, 2:55:44 PM2/25/15
to Capistrano
I'm not sure how to assign the output of a command to a variable within config/deploy.rb that can then be later included in an execute command.

Exactly like that, variables are variables. You could use the set()/fetch() API, but there's no need. 

deadb...@gmail.com

unread,
Feb 25, 2015, 4:00:45 PM2/25/15
to capis...@googlegroups.com
that worked, sort of.  I'm getting either CRLF or LF as the trailing character(s).   Can you show me an example of using a chomp on a variable?  I've tried

      puts "%DEBUG%:myVar:#{myVar}.chomp(\r\n)****"

but that doesn't work.

Lee Hambley

unread,
Feb 25, 2015, 5:23:51 PM2/25/15
to Capistrano
Reply all
Reply to author
Forward
0 new messages