Class: Fastlane::Actions::BitriseBuildStatusAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::BitriseBuildStatusAction
- Defined in:
- lib/fastlane/plugin/bitrise_automation/actions/bitrise_build_status_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .get_status(params, build_slug) ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
35 36 37 |
# File 'lib/fastlane/plugin/bitrise_automation/actions/bitrise_build_status_action.rb', line 35 def self. ["Mario Cecchi", "Henrique Alves"] end |
.available_options ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/fastlane/plugin/bitrise_automation/actions/bitrise_build_status_action.rb', line 43 def self. [ FastlaneCore::ConfigItem.new(key: :app_slug, env_name: "BITRISE_APP_SLUG", description: "The app slug of the project on Bitrise", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :access_token, env_name: "BITRISE_ACCESS_TOKEN", description: "The personal access token used to call Bitrise API", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :build_slug, env_name: "BITRISE_BUILD_SLUG", description: "The slug that identifies the build on Bitrise", optional: false, type: String) ] end |
.description ⇒ Object
31 32 33 |
# File 'lib/fastlane/plugin/bitrise_automation/actions/bitrise_build_status_action.rb', line 31 def self.description "Get the status of the Bitrise build" end |
.get_status(params, build_slug) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fastlane/plugin/bitrise_automation/actions/bitrise_build_status_action.rb', line 14 def self.get_status(params, build_slug) response = Helper::BitriseRequestHelper.get(params, "builds/#{build_slug}") if response.code == "200" json_response = JSON.parse(response.body)['data'] else UI.crash!("Error fetching build status on Bitrise.io. Status code: #{response.code}. #{response}") end build_infos = {} build_infos["is_on_hold"] = json_response["is_on_hold"] build_infos["status"] = json_response["status"] build_infos["status_text"] = json_response["status_text"] build_infos["abort_reason"] = json_response["abort_reason"] build_infos end |
.is_supported?(platform) ⇒ Boolean
63 64 65 |
# File 'lib/fastlane/plugin/bitrise_automation/actions/bitrise_build_status_action.rb', line 63 def self.is_supported?(platform) true end |
.return_value ⇒ Object
39 40 41 |
# File 'lib/fastlane/plugin/bitrise_automation/actions/bitrise_build_status_action.rb', line 39 def self.return_value "Returns the information of the Bitrise build" end |
.run(params) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/fastlane/plugin/bitrise_automation/actions/bitrise_build_status_action.rb', line 7 def self.run(params) status = get_status(params, params[:build_slug]) FastlaneCore::PrintTable.print_values(config: status, title: "Bitrise build '#{params[:build_slug]}' status") status end |