Class: PlatformAPI::Release

Inherits:
Object
  • Object
show all
Defined in:
lib/platform-api/client.rb

Overview

A release represents a combination of code, config vars and add-ons for an app on Heroku.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Release

Returns a new instance of Release.



1186
1187
1188
# File 'lib/platform-api/client.rb', line 1186

def initialize(client)
  @client = client
end

Instance Method Details

#create(app_id_or_app_name, body) ⇒ Object

Create new release. The API cannot be used to create releases on Bamboo apps.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • body:

    the object to pass as the request payload



1209
1210
1211
# File 'lib/platform-api/client.rb', line 1209

def create(app_id_or_app_name, body)
  @client.release.create(app_id_or_app_name, body)
end

#info(app_id_or_app_name, release_id_or_release_version) ⇒ Object

Info for existing release.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • release_id_or_release_version:

    unique identifier of release or unique version assigned to the release



1194
1195
1196
# File 'lib/platform-api/client.rb', line 1194

def info(app_id_or_app_name, release_id_or_release_version)
  @client.release.info(app_id_or_app_name, release_id_or_release_version)
end

#list(app_id_or_app_name) ⇒ Object

List existing releases.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app



1201
1202
1203
# File 'lib/platform-api/client.rb', line 1201

def list(app_id_or_app_name)
  @client.release.list(app_id_or_app_name)
end

#rollback(app_id_or_app_name, body) ⇒ Object

Rollback to an existing release.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • body:

    the object to pass as the request payload



1217
1218
1219
# File 'lib/platform-api/client.rb', line 1217

def rollback(app_id_or_app_name, body)
  @client.release.rollback(app_id_or_app_name, body)
end