Skip to content

Commit

Permalink
Merge pull request #159 from nysthee/feature/alternative-application-…
Browse files Browse the repository at this point in the history
…name

Add support for specifying an alternative app name
  • Loading branch information
rberrelleza committed Feb 28, 2016
2 parents 6287393 + 0d15a0f commit c2cc6bf
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/hipchat/capistrano/tasks/hipchat.rake
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,21 @@ namespace :hipchat do

def deployment_name
if fetch(:branch, nil)
application = fetch(:application)
branch = fetch(:branch)
real_revision = fetch(:real_revision)

name = "#{application}/#{branch}"
name = "#{application_name}/#{branch}"
name += " (revision #{real_revision[0..7]})" if real_revision
name
else
application
application_name
end
end

def application_name
alt_application_name.nil? ? fetch(:application) : alt_application_name
end

def message_color
fetch(:hipchat_color, 'yellow')
end
Expand All @@ -101,6 +104,10 @@ namespace :hipchat do
fetch(:hipchat_deploy_user, 'Deploy')
end

def alt_application_name
fetch(:hipchat_app_name, nil)
end

def human
user = ENV['HIPCHAT_USER'] || fetch(:hipchat_human)
user = user || if (u = %x{git config user.name}.strip) != ''
Expand Down

0 comments on commit c2cc6bf

Please sign in to comment.