Class: PlatformAPI::Build

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

Overview

A build represents the process of transforming a code tarball into a slug

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Build

Returns a new instance of Build.



1499
1500
1501
# File 'lib/platform-api/client.rb', line 1499

def initialize(client)
  @client = client
end

Instance Method Details

#cancel(app_id_or_app_name, build_id) ⇒ Object

Cancel running build.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • build_id:

    unique identifier of build



1537
1538
1539
# File 'lib/platform-api/client.rb', line 1537

def cancel(app_id_or_app_name, build_id)
  @client.build.cancel(app_id_or_app_name, build_id)
end

#create(app_id_or_app_name, body = {}) ⇒ Object

Create a new build.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • body:

    the object to pass as the request payload



1507
1508
1509
# File 'lib/platform-api/client.rb', line 1507

def create(app_id_or_app_name, body = {})
  @client.build.create(app_id_or_app_name, body)
end

#delete_cache(app_id_or_app_name) ⇒ Object

Destroy a build cache.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app



1529
1530
1531
# File 'lib/platform-api/client.rb', line 1529

def delete_cache(app_id_or_app_name)
  @client.build.delete_cache(app_id_or_app_name)
end

#info(app_id_or_app_name, build_id) ⇒ Object

Info for existing build.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • build_id:

    unique identifier of build



1515
1516
1517
# File 'lib/platform-api/client.rb', line 1515

def info(app_id_or_app_name, build_id)
  @client.build.info(app_id_or_app_name, build_id)
end

#list(app_id_or_app_name) ⇒ Object

List existing build.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app



1522
1523
1524
# File 'lib/platform-api/client.rb', line 1522

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