class Spaceship::TestFlight::Build
Constants
- BUILD_STATES
Attributes
@example
"152"
@example
"com.sample.app"
@example
"testflight.build.state.submit.ready"
@example
"testflight.build.state.processing"
Internal build ID (int) @example
19285309
@example
"testflight.build.state.testing.active"
@example
"testflight.build.state.processing"
@example
"1.0"
Public Class Methods
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 109 def self.all(app_id: nil, platform: nil, retry_count: 0) trains = BuildTrains.all(app_id: app_id, platform: platform, retry_count: retry_count) trains.values.flatten end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 120 def self.all_processing_builds(app_id: nil, platform: nil, retry_count: 0) all(app_id: app_id, platform: platform, retry_count: retry_count).find_all(&:processing?) end
Just the builds, as a flat array, that are still processing
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 125 def self.all_waiting_for_review(app_id: nil, platform: nil, retry_count: 0) all(app_id: app_id, platform: platform, retry_count: retry_count).select { |app| app.external_state == 'testflight.build.state.review.waiting' } end
Just the builds, as a flat array, that are waiting for beta review
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 114 def self.builds_for_train(app_id: nil, platform: nil, train_version: nil, retry_count: 3) builds_data = client.get_builds_for_train(app_id: app_id, platform: platform, train_version: train_version, retry_count: retry_count) builds_data.map { |data| self.new(data) } end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 104 def self.find(app_id: nil, build_id: nil) attrs = client.get_build(app_id: app_id, build_id: build_id) self.new(attrs) end
Find a Build
by ‘build_id`.
@return (Spaceship::TestFlight::Build
)
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 129 def self.latest(app_id: nil, platform: nil) all(app_id: app_id, platform: platform).sort_by(&:upload_date).last end
Public Instance Methods
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 152 def active? external_state == BUILD_STATES[:active] end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 227 def add_group!(group) client.add_group_to_build(app_id: app_id, group_id: group.id, build_id: id) end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 168 def approved? external_state == BUILD_STATES[:approved] end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 223 def expire! client.expire_build(app_id: app_id, build_id: id, build: self) end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 160 def export_compliance_missing? external_state == BUILD_STATES[:export_compliance_missing] end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 232 def find_app_store_connect_build builds = Spaceship::ConnectAPI::Build.all( app_id: app_id, version: self.train_version, build_number: self.build_version ) return builds.find { |build| build.id == id } end
Bridges the TestFlight::Build
to the App
Store Connect API build
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 172 def processed? active? || ready_to_submit? || export_compliance_missing? || review_rejected? end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 156 def processing? external_state == BUILD_STATES[:processing] end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 144 def ready_to_submit? external_state == BUILD_STATES[:ready_to_submit] end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 148 def ready_to_test? external_state == BUILD_STATES[:ready_to_test] end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 140 def reload self.raw_data = self.class.find(app_id: app_id, build_id: id).raw_data end
reload the raw_data resource for this build. This is useful when we start with a partial build response as returned by the BuildTrains
, but then need to look up some attributes on the full build representation.
Note: this will overwrite any non-saved changes to the object
@return (Spaceship::Base::DataHash
) the raw_data of the build.
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 164 def review_rejected? external_state == BUILD_STATES[:review_rejected] end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 205 def save! client.put_build(app_id: app_id, build_id: id, build: self) end
saves the changes to the Build
object to TestFlight
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 216 def submit_for_testflight_review! return if ready_to_test? return if approved? Spaceship::ConnectAPI.post_beta_app_review_submissions(build_id: id) end
Source
# File spaceship/lib/spaceship/test_flight/build.rb, line 209 def update_build_information!(description: nil, feedback_email: nil, whats_new: nil) test_info.description = description if description test_info.feedback_email = feedback_email if feedback_email test_info.whats_new = whats_new if whats_new save! end