Class: Fastlane::Actions::DeploygateAction
- Inherits:
-
Fastlane::Action
- Object
- Fastlane::Action
- Fastlane::Actions::DeploygateAction
- Defined in:
- lib/fastlane/actions/deploygate.rb
Constant Summary collapse
- DEPLOYGATE_URL_BASE =
'https://deploygate.com'
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
action_name, authors, details, sh, step_text
Class Method Details
.author ⇒ Object
119 120 121 |
# File 'lib/fastlane/actions/deploygate.rb', line 119 def self. "tnj" end |
.available_options ⇒ Object
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 |
# File 'lib/fastlane/actions/deploygate.rb', line 83 def self. [ FastlaneCore::ConfigItem.new(key: :api_token, env_name: "DEPLOYGATE_API_TOKEN", description: "Deploygate API Token", verify_block: Proc.new do |value| raise "No API Token for DeployGate given, pass using `api_token: 'token'`".red unless value.to_s.length > 0 end), FastlaneCore::ConfigItem.new(key: :user, env_name: "DEPLOYGATE_USER", description: "Target username or organization name", verify_block: Proc.new do |value| raise "No User for app given, pass using `user: 'user'`".red unless value.to_s.length > 0 end), FastlaneCore::ConfigItem.new(key: :ipa, env_name: "DEPLOYGATE_IPA_PATH", 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: :message, env_name: "DEPLOYGATE_MESSAGE", description: "Release Notes", default_value: "No changelog provided") ] end |
.description ⇒ Object
79 80 81 |
# File 'lib/fastlane/actions/deploygate.rb', line 79 def self.description "Upload a new build to DeployGate" end |
.is_supported?(platform) ⇒ Boolean
16 17 18 |
# File 'lib/fastlane/actions/deploygate.rb', line 16 def self.is_supported?(platform) platform == :ios end |
.output ⇒ Object
111 112 113 114 115 116 117 |
# File 'lib/fastlane/actions/deploygate.rb', line 111 def self.output [ ['DEPLOYGATE_URL', 'URL of the newly uploaded build'], ['DEPLOYGATE_REVISION', 'auto incremented revision number'], ['DEPLOYGATE_APP_INFO', 'Contains app revision, bundle identifier, etc.'] ] end |
.run(options) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fastlane/actions/deploygate.rb', line 20 def self.run() require 'shenzhen' require 'shenzhen/plugins/deploygate' # Available options: https://deploygate.com/docs/api Helper.log.info 'Starting with ipa upload to DeployGate... this could take some time ⏳'.green client = Shenzhen::Plugins::DeployGate::Client.new( [:api_token], [:user] ) return [:ipa] if Helper.test? response = client.upload_build([:ipa], .values) if parse_response(response) Helper.log.info "DeployGate URL: #{Actions.lane_context[SharedValues::DEPLOYGATE_URL]}" Helper.log.info "Build successfully uploaded to DeployGate as revision \##{Actions.lane_context[SharedValues::DEPLOYGATE_REVISION]}!".green else raise 'Error when trying to upload ipa to DeployGate'.red end end |