Class: Fastlane::Actions::HockeyAction
- Inherits:
-
Fastlane::Action
- Object
- Fastlane::Action
- Fastlane::Actions::HockeyAction
- Defined in:
- lib/fastlane/actions/hockey.rb
Class Method Summary collapse
- .author ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .run(options) ⇒ Object
Methods inherited from Fastlane::Action
Class Method Details
.author ⇒ Object
126 127 128 |
# File 'lib/fastlane/actions/hockey.rb', line 126 def self. "KrauseFx" end |
.available_options ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/fastlane/actions/hockey.rb', line 62 def self. [ FastlaneCore::ConfigItem.new(key: :api_token, env_name: "FL_HOCKEY_API_TOKEN", description: "API Token for Hockey Access", verify_block: Proc.new do |value| raise "No API token for Hockey given, pass using `api_token: 'token'`".red unless (value and not value.empty?) end), FastlaneCore::ConfigItem.new(key: :ipa, env_name: "FL_HOCKEY_IPA", description: "Path to your IPA file. Optional if you use the `ipa` or `xcodebuild` action", default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH], verify_block: Proc.new do |value| raise "Couldn't find ipa file at path '#{value}'".red unless File.exists?(value) end), FastlaneCore::ConfigItem.new(key: :dsym, env_name: "FL_HOCKEY_DSYM", description: "Path to your DSYM file", optional: true, verify_block: Proc.new do |value| # validation is done in the action end), FastlaneCore::ConfigItem.new(key: :notes, env_name: "FL_HOCKEY_NOTES", description: "Beta Notes", default_value: "No changelog given"), FastlaneCore::ConfigItem.new(key: :notify, env_name: "FL_HOCKEY_NOTIFY", description: "Notify testers? 1 for yes", default_value: "1"), FastlaneCore::ConfigItem.new(key: :status, env_name: "FL_HOCKEY_STATUS", description: "Download status: 1 = No user can download; 2 = Available for download", default_value: "2"), FastlaneCore::ConfigItem.new(key: :notes_type, env_name: "FL_HOCKEY_NOTES_TYPE", description: "Notes type for your :notes, 0 = Textile, 1 = Markdown (default)", default_value: "1"), FastlaneCore::ConfigItem.new(key: :release_type, env_name: "FL_HOCKEY_RELEASE_TYPE", description: "Release type of the app", default_value: "0"), FastlaneCore::ConfigItem.new(key: :mandatory, env_name: "FL_HOCKEY_MANDATORY", description: "Set to 1 to make this update mandatory", default_value: "0"), FastlaneCore::ConfigItem.new(key: :teams, env_name: "FL_HOCKEY_TEAMS", description: "Comma separated list of team ID numbers to which this build will be restricted", optional: true), FastlaneCore::ConfigItem.new(key: :tags, env_name: "FL_HOCKEY_TAGS", description: "Comma separated list of tags which will receive access to the build", optional: true) ] end |
.description ⇒ Object
58 59 60 |
# File 'lib/fastlane/actions/hockey.rb', line 58 def self.description "Upload a new build to HockeyApp" end |
.is_supported?(platform) ⇒ Boolean
130 131 132 |
# File 'lib/fastlane/actions/hockey.rb', line 130 def self.is_supported?(platform) platform == :ios end |
.output ⇒ Object
119 120 121 122 123 124 |
# File 'lib/fastlane/actions/hockey.rb', line 119 def self.output [ ['HOCKEY_DOWNLOAD_LINK', 'The newly generated download link for this build'], ['HOCKEY_BUILD_INFORMATION', 'contains all keys/values from the HockeyApp API, like :title, :bundle_identifier'] ] end |
.run(options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/fastlane/actions/hockey.rb', line 13 def self.run() # Available options: http://support.hockeyapp.net/kb/api/api-versions#upload-version require 'shenzhen' require 'shenzhen/plugins/hockeyapp' if [:dsym] dsym_filename = [:dsym] else dsym_path = [:ipa].gsub('ipa', 'app.dSYM.zip') if File.exist?(dsym_path) dsym_filename = dsym_path else Helper.log.info "Symbols not found on path #{File.(dsym_path)}. Crashes won't be symbolicated properly".yellow end end raise "Symbols on path '#{File.(dsym_filename)}' not found".red if (dsym_filename && !File.exist?(dsym_filename)) Helper.log.info 'Starting with ipa upload to HockeyApp... this could take some time.'.green client = Shenzhen::Plugins::HockeyApp::Client.new([:api_token]) values = .values values[:dsym_filename] = dsym_path values[:notes_type] = [:notes_type] return values if Helper.test? response = client.upload_build([:ipa], values) case response.status when 200...300 url = response.body['public_url'] Actions.lane_context[SharedValues::HOCKEY_DOWNLOAD_LINK] = url Actions.lane_context[SharedValues::HOCKEY_BUILD_INFORMATION] = response.body Helper.log.info "Public Download URL: #{url}" if url Helper.log.info 'Build successfully uploaded to HockeyApp!'.green else Helper.log.fatal "Error uploading to HockeyApp: #{response.body}" raise 'Error when trying to upload ipa to HockeyApp'.red end end |