class Spaceship::Tunes::Build

Represents a build which is inside the build train

Attributes

app_name[RW]

@return (String) The name of the app this build is for

apple_id[RW]

@return (String) The App identifier of this app, provided by App Store Connect @example

"1013943394"
build_train[RW]

@return (Spaceship::Tunes::BuildTrain) A reference to the build train this build is contained in

build_version[RW]

@return (String) The build version (not the version number), but also is named `build number`

crash_count[RW]

@return (Integer) Might be nil. The number of crashes of this build

external_expiry_date[RW]

@return (Integer): When is the external build going to expire?

external_install_count[RW]

@return (Integer) Number of installs for this build that come from external users

external_testing_enabled[R]

@return (Bool) Is external beta testing enabled for this train? Only one train can have enabled testing.

external_testing_status[R]

@return (String) The status of internal testflight testing for this build. One of active, submitForReview, approvedInactive, waiting

icon_url[RW]

@return (String) URL to the app icon of this build (150x150px)

id[RW]

@return (Integer) The ID generated by App Store Connect

install_count[RW]

@return (Integer) Number of installs of this build

internal_expiry_date[RW]

@return (Integer) When is this build going to be invalid

internal_install_count[RW]

@return (Integer) Number of installs for this build that come from internal users

internal_testing_enabled[R]

@return (Bool) Is internal beta testing enabled for this train? Only one train can have enabled testing.

platform[RW]

@return (String) The platform of this build (e.g. 'ios')

processing[RW]

@return (Boolean) Is this build currently processing?

processing_state[RW]

@return (String) The build processing state, may be nil @example “invalidBinary” @example “processingFailed”

ready_to_install[RW]

@return (Bool):

session_count[RW]

@return (Integer) Might be nil. The number of sessions for this build

train_version[RW]

@return (String) The version number (e.g. 1.3)

upload_date[RW]

@return (Integer) The number of ticks since 1970 (e.g. 1413966436000)

valid[RW]

@return (Boolean)

watch_kit_enabled[RW]

@return (Bool) Does this build support WatchKit?

Public Instance Methods

cancel_beta_review!() click to toggle source

This will cancel the review process for this TestFlight build

# File spaceship/lib/spaceship/tunes/build.rb, line 207
def cancel_beta_review!
  client.remove_testflight_build_from_review!(app_id: self.apple_id,
                                               train: self.train_version,
                                        build_number: self.build_version,
                                            platform: self.platform)
end
details() click to toggle source
# File spaceship/lib/spaceship/tunes/build.rb, line 124
def details
  response = client.build_details(app_id: self.apple_id,
                                   train: self.train_version,
                            build_number: self.build_version,
                                platform: self.platform)
  response['apple_id'] = self.apple_id
  BuildDetails.factory(response)
end
setup() click to toggle source
Calls superclass method
# File spaceship/lib/spaceship/tunes/build.rb, line 117
def setup
  super

  self.external_expiry_date ||= 0
  self.internal_expiry_date ||= 0
end
submit_for_beta_review!(metadata) click to toggle source

This will submit this build for TestFlight beta review @param metadata [Hash] A hash containing the following information (keys must be symbols):

{
  # Required Metadata:
   changelog: "Changelog",
   description: "Your Description",
   feedback_email: "Email Address for Feedback",
   marketing_url: "https://marketing.com",
   first_name: "Felix",
   last_name: "Krause",
   review_email: "Contact email address for Apple",
   phone_number: "0128383383",
   review_notes: "Review notes"

 # Optional Metadata:
   privacy_policy_url: nil,
   review_notes: nil,
   review_user_name: nil,
   review_password: nil,
   encryption: false
}

Note that iTC will pull a lot of this information from previous builds or the app store information, all of the required values must be set either in this hash or automatically for this to work

# File spaceship/lib/spaceship/tunes/build.rb, line 177
def submit_for_beta_review!(metadata)
  parameters = {
    app_id: self.apple_id,
    train: self.train_version,
    build_number: self.build_version,
    platform: self.platform
  }.merge(metadata)

  client.submit_testflight_build_for_review!(parameters)

  return parameters
end
testing_status() click to toggle source

@return [String] A nicely formatted string about the state of this build @examples:

External, Internal, Inactive, Expired
# File spaceship/lib/spaceship/tunes/build.rb, line 193
def testing_status
  testing ||= "External" if self.external_testing_enabled
  testing ||= "Internal" if self.internal_testing_enabled

  if Time.at(self.internal_expiry_date / 1000) > Time.now
    testing ||= "Inactive"
  else
    testing = "Expired"
  end

  return testing
end
update_build_information!(whats_new: nil, description: nil, feedback_email: nil) click to toggle source
# File spaceship/lib/spaceship/tunes/build.rb, line 138
def update_build_information!(whats_new: nil,
                              description: nil,
                              feedback_email: nil)
  parameters = {
    app_id: self.apple_id,
    train: self.train_version,
    build_number: self.build_version,
    platform: self.platform
  }.merge({
    whats_new: whats_new,
    description: description,
    feedback_email: feedback_email
  })
  client.update_build_information!(parameters)
end