class Escobar::Heroku::Release

Class representing a heroku release

Attributes

app_id[R]
app_name[R]
build_id[R]
client[R]
command_id[RW]
github_url[RW]
id[R]
pipeline_name[RW]
sha[RW]

Public Class Methods

new(client, app_id, build_id, id) click to toggle source
# File lib/escobar/heroku/release.rb, line 12
def initialize(client, app_id, build_id, id)
  @id       = id
  @app_id   = app_id
  @build_id = build_id
  @client   = client
end

Public Instance Methods

app() click to toggle source
# File lib/escobar/heroku/release.rb, line 23
def app
  @app ||= Escobar::Heroku::App.new(client, app_id)
end
build() click to toggle source
# File lib/escobar/heroku/release.rb, line 27
def build
  @build ||= Escobar::Heroku::Build.new(client, app.id, build_id)
end
dashboard_release_output_url() click to toggle source
# File lib/escobar/heroku/release.rb, line 39
def dashboard_release_output_url
  "https://dashboard.heroku.com/apps/#{app.name}/activity/releases/#{id}"
end
info() click to toggle source
# File lib/escobar/heroku/release.rb, line 19
def info
  @info ||= client.heroku.get("/apps/#{app_id}/releases/#{id}")
end
ref() click to toggle source
# File lib/escobar/heroku/release.rb, line 35
def ref
  slug && slug.ref
end
repository() click to toggle source
# File lib/escobar/heroku/release.rb, line 43
def repository
  github_url && github_url.match(Escobar::GitHub::REPOSITORY_REGEX)[1]
end
slug() click to toggle source
# File lib/escobar/heroku/release.rb, line 31
def slug
  @slug ||= Escobar::Heroku::Slug.new(client, app.id, info["slug"]["id"])
end
status() click to toggle source
# File lib/escobar/heroku/release.rb, line 47
def status
  info["status"]
end
to_job_json() click to toggle source
# File lib/escobar/heroku/release.rb, line 51
def to_job_json
  {
    sha: sha,
    name: pipeline_name,
    repo: repository,
    app_id: app_id,
    app_name: app.name,
    build_id: build_id,
    release_id: id,
    command_id: command_id,
    target_url: dashboard_release_output_url,
    deployment_url: github_url
  }
end