class Object

Public Instance Methods

commit_details() click to toggle source
# File lib/capistrano/tasks/fireworks.rb, line 48
def commit_details
  within repo_path do
    commit, author, subject = capture(:git, "log -n 1 --format=format:\"%h%n%an%n%s\" #{fetch(:branch)}").split("\n")
    { commit: commit, commit_url: "#{fetch(:fireworks_repo_url)}/commits/#{commit}", author: author, subject: subject }
  end
end
default_attributes() click to toggle source
# File lib/capistrano/tasks/fireworks.rb, line 28
def default_attributes
  { token: fetch(:fireworks_token), name: fetch(:stage), branch: fetch(:branch),
      username: username }
end
server_post(additional_attributes ={}) click to toggle source
# File lib/capistrano/tasks/fireworks.rb, line 33
def server_post(additional_attributes ={})
  within release_path do
    data = JSON.dump(default_attributes.merge(additional_attributes))
    execute :curl, " -s -S -H \"Content-Type: application/json\" -X POST --data '#{data}' #{fetch(:fireworks_server_url)}/entries"
  end
end
slack_post(additional_attributes ={}) click to toggle source
# File lib/capistrano/tasks/fireworks.rb, line 40
def slack_post(additional_attributes ={})
  Capistrano::Fireworks::SlackPost.new(hook_url: fetch(:fireworks_slack_hook), attributes: default_attributes.merge(additional_attributes)).call
end
username() click to toggle source
# File lib/capistrano/tasks/fireworks.rb, line 44
def username
  run_locally { "#{capture(:id, '-u -n')}(#{capture(:git, 'config user.name')})" }
end