FYI about using perforce labels with Capistrano

38 views
Skip to first unread message

RandyInLA

unread,
Apr 4, 2012, 10:35:10 PM4/4/12
to Capistrano
I have seen a few posts regarding how to use perforce labels with
Capistrano and now notice the perforce rev_no(revision) method has
been updated to include a new :p4_label variable. I have never had an
issue using perforce labels in the past without this newly
added :p4_label variable. (can't find any discussions
regarding :p4_label in this group)

@appname-x.x.x.x is our label convention. By setting the
revision=@appname-x.x.x.x on the cmd line, Capistrano has always
(well, as long as I've been using it) been able to grab the correct
version of my files.
ex: $ cap <environment> -S revision=@appname-x.x.x.x deploy
(I use the capistrano-ext rubygem to set multiple environments)

Also, by setting :release_name in my deploy.rb file, I am able to pull
the perforce label apart and use it as the release dir name, as in:
set(:release_name) { set :deploy_timestamped, true;
"#{ Time.now.utc.strftime('%Y_%m_%d_%H%M') }_#{ revision.gsub('.',
'_').gsub('@', '') }" }

It would be nice to be able to just do "$ cap <environment> @appname-
x.x.x.x deploy" and have Capistrano understand the revision... always
adding the "-S revision=" seems longer than it needs to be.

Cheers,
-=Randy
Reply all
Reply to author
Forward
0 new messages