Class: Fastlane::Actions::AppetizeAction
- Inherits:
-
Fastlane::Action
- Object
- Fastlane::Action
- Fastlane::Actions::AppetizeAction
- Defined in:
- lib/fastlane/actions/appetize.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .run(options) ⇒ Object
Methods inherited from Fastlane::Action
action_name, author, details, return_value, sh, step_text
Class Method Details
.authors ⇒ Object
130 131 132 |
# File 'lib/fastlane/actions/appetize.rb', line 130 def self. ["klundberg", "giginet"] end |
.available_options ⇒ Object
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 118 119 |
# File 'lib/fastlane/actions/appetize.rb', line 89 def self. [ FastlaneCore::ConfigItem.new(key: :api_token, env_name: "APPETIZE_API_TOKEN", description: "Appetize.io API Token", is_string: true, verify_block: proc do |value| UI.user_error!("No API Token for Appetize.io given, pass using `api_token: 'token'`") unless value.to_s.length > 0 end), FastlaneCore::ConfigItem.new(key: :url, env_name: "APPETIZE_URL", description: "Target url of the zipped build. Either this or `path` must be specified", is_string: true, optional: true), FastlaneCore::ConfigItem.new(key: :path, env_name: "APPETIZE_FILE_PATH", description: "Path to zipped build on the local filesystem. Either this or `url` must be specified", is_string: true, optional: true), FastlaneCore::ConfigItem.new(key: :public_key, env_name: "APPETIZE_PUBLICKEY", description: "Public key of the app you wish to update. If not provided, then a new app entry will be created on Appetize.io", is_string: true, optional: true), FastlaneCore::ConfigItem.new(key: :note, env_name: "APPETIZE_NOTE", description: "Notes you wish to add to the uploaded app", is_string: true, optional: true) ] end |
.description ⇒ Object
85 86 87 |
# File 'lib/fastlane/actions/appetize.rb', line 85 def self.description "Create or Update apps on Appetize.io" end |
.is_supported?(platform) ⇒ Boolean
11 12 13 |
# File 'lib/fastlane/actions/appetize.rb', line 11 def self.is_supported?(platform) platform == :ios end |
.output ⇒ Object
121 122 123 124 125 126 127 128 |
# File 'lib/fastlane/actions/appetize.rb', line 121 def self.output [ ['APPETIZE_PRIVATE_KEY', 'a string that is used to prove "ownership" of your app.'], ['APPETIZE_PUBLIC_KEY', 'a public identiifer for your app. Use this to update your app after it has been initially created'], ['APPETIZE_APP_URL', 'a page to test and share your app.'], ['APPETIZE_MANAGE_URL', 'a page to manage your app.'] ] end |
.run(options) ⇒ Object
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 |
# File 'lib/fastlane/actions/appetize.rb', line 15 def self.run() require 'net/http' require 'net/http/post/multipart' require 'uri' require 'json' params = { platform: 'ios' } if [:path] params[:file] = UploadIO.new([:path], 'application/zip') else UI.user_error!('url parameter is required if no file path is specified') if [:url].nil? params[:url] = [:url] end params[:note] = [:note] if [:note].to_s.length > 0 uri = URI.parse(appetize_url()) req = create_request(uri, params) req.basic_auth([:api_token], nil) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true response = http.request(req) UI.user_error!("Error uploading app to Appetize.io") unless parse_response(response) UI.("App URL: #{Actions.lane_context[SharedValues::APPETIZE_APP_URL]}") UI.("Manage URL: #{Actions.lane_context[SharedValues::APPETIZE_MANAGE_URL]}") UI.("App Private Key: #{Actions.lane_context[SharedValues::APPETIZE_PRIVATE_KEY]}") UI.success("Build successfully uploaded to Appetize.io") end |