Class: Fastlane::Actions::UploadToSimplemdmAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::UploadToSimplemdmAction
- Defined in:
- lib/fastlane/plugin/simplemdm/actions/upload_to_simplemdm_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
32 33 34 |
# File 'lib/fastlane/plugin/simplemdm/actions/upload_to_simplemdm_action.rb', line 32 def self. ["iotashan"] end |
.available_options ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/fastlane/plugin/simplemdm/actions/upload_to_simplemdm_action.rb', line 41 def self. [ FastlaneCore::ConfigItem.new(key: :api_key, env_name: "SIMPLEMDM_API_KEY", # The name of the environment variable description: "API Token for SimpleMDM"), # a short description of this parameter FastlaneCore::ConfigItem.new(key: :app_id, env_name: "SIMPLEMDM_APP_ID", description: "The SimpleMDM App ID that will be uploaded", is_string: false), FastlaneCore::ConfigItem.new(key: :ipa_path, env_name: "SIMPLEMDM_IPA_PATH", description: "The the path to the IPA", default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH], verify_block: proc do |value| UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :name, env_name: "SIMPLEMDM_APP_NAME", # The name of the environment variable optional: true, description: "The name that SimpleMDM will use to reference this app. If left blank, SimpleMDM will automatically set this to the app name specified by the binary"), # a short description of this parameter FastlaneCore::ConfigItem.new(key: :deploy_to, env_name: "SIMPLEMDM_DEPLOY_TO", # The name of the environment variable description: "Deploy the app to associated devices immediately after the app has been uploaded and processed. Possible values are none, outdated or all", # a short description of this parameter default_value: "none", verify_block: proc do |value| accepted_formats = ["none", "outdated", "all"] UI.user_error!("Only \"none\" \"outdated\" or \"all\" values are allowed, you provided \"#{value}\"") unless accepted_formats.include? value end) ] end |
.description ⇒ Object
28 29 30 |
# File 'lib/fastlane/plugin/simplemdm/actions/upload_to_simplemdm_action.rb', line 28 def self.description "Upload IPA to Simple MDM" end |
.details ⇒ Object
36 37 38 39 |
# File 'lib/fastlane/plugin/simplemdm/actions/upload_to_simplemdm_action.rb', line 36 def self.details # Optional: "When using SimpleMDM for iOS app distribution, this provides an automate way to send updates directly to SimpleMDM" end |
.is_supported?(platform) ⇒ Boolean
72 73 74 |
# File 'lib/fastlane/plugin/simplemdm/actions/upload_to_simplemdm_action.rb', line 72 def self.is_supported?(platform) platform == :ios end |
.run(params) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fastlane/plugin/simplemdm/actions/upload_to_simplemdm_action.rb', line 11 def self.run(params) SimpleMDM.api_key = (params[:api_key]).to_s data = File.open((params[:ipa_path]).to_s) app = SimpleMDM::App.find(params[:app_id]) app.binary = data app.name = params[:name] if params[:name] UI.("Uploading #{app.name} `#{params[:ipa_path]}` to SimpleMDM for app ID #{params[:app_id]} deploying to #{params[:deploy_to]}") app.save(params[:deploy_to]) UI.("Uploaded #{app.name} (#{app.bundle_identifier} #{app.version})") end |