Class: Fastlane::Actions::ZealotVersionCheckAction

Inherits:
Action
  • Object
show all
Extended by:
Helper::ZealotHelper
Defined in:
lib/fastlane/plugin/zealot/actions/zealot_version_check.rb

Constant Summary

Constants included from Helper::ZealotHelper

Helper::ZealotHelper::UPLOAD_APP_PARAMS_KEYS

Documentation collapse

Class Method Summary collapse

Methods included from Helper::ZealotHelper

avialable_upload_app_params, build_app_version_check_params, build_table_data, check_app_version, detect_ci_url, detect_source, gitlab?, hidden_keys, http_request, jenkins?, make_connection, print_table, show_error, sync_deivce, upload_app, upload_app_params, upload_debug_file, upload_debug_file_params

Class Method Details

.authorsObject



139
140
141
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 139

def self.authors
  ['icyleaf']
end

.available_optionsObject



51
52
53
54
55
56
57
58
59
60
61
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
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 51

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :endpoint,
                                 env_name: 'ZEALOT_ENDPOINT',
                                 description: 'The endpoint of zealot',
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :token,
                                 env_name: 'ZEALOT_TOKEN',
                                 description: 'The token of user',
                                 sensitive: true,
                                 verify_block: proc do |value|
                                   UI.user_error!("No user token for Zealot given, pass using `token: 'token'`") if value.nil? || value.empty?
                                 end,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :channel_key,
                                 env_name: 'ZEALOT_CHANNEL_KEY',
                                 description: 'The key of app\'s channel',
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :bundle_id,
                                 env_name: 'ZEALOT_BUNDLE_ID',
                                 description: 'The bundle id(package name) of app',
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :release_version,
                                 env_name: 'ZEALOT_RELEASE_VERSION',
                                 description: 'The release version of app',
                                 optional: true,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :build_version,
                                 env_name: 'ZEALOT_BUILD_VERSION',
                                 description: 'The build version of app',
                                 optional: true,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :git_commit,
                                 env_name: 'ZEALOT_GIT_COMMIT',
                                 description: 'The latest git commit of app',
                                 default_value: ENV['GIT_COMMIT'] || ENV['CI_COMMIT_SHA'],
                                 optional: true,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :verify_ssl,
                                 env_name: 'ZEALOT_VERIFY_SSL',
                                 description: 'Should verify SSL of zealot service',
                                 optional: true,
                                 default_value: true,
                                 type: Boolean),
    FastlaneCore::ConfigItem.new(key: :fail_on_error,
                                 env_name: 'ZEALOT_FAIL_ON_ERROR',
                                 description: 'Should an error http request cause a failure? (true/false)',
                                 optional: true,
                                 default_value: false,
                                 type: Boolean)
  ]
end

.categoryObject



135
136
137
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 135

def self.category
  :beta
end

.descriptionObject



47
48
49
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 47

def self.description
  'Check app version exists from Zealot'
end

.example_codeObject



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 104

def self.example_code
  [
    'zealot_version_check(
      endpoint: "...",
      token: "...",
      channel_key: "...",
      bundle_id: "im.ews.zealot",
      git_commit: "ec7b5859f77882892325840eae0716fcaab6c14f"
    )',
    'zealot_version_check(
      endpoint: "...",
      token: "...",
      channel_key: "...",
      bundle_id: "im.ews.zealot",
      release_version: "1.0.0",
      build_version: "1"
    )',
  ]
end

.is_supported?(_) ⇒ Boolean

Returns:

  • (Boolean)


143
144
145
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 143

def self.is_supported?(_)
  true
end

.outputObject



124
125
126
127
128
129
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 124

def self.output
  [
    ['ZEALOT_VERSION_EXISTED', 'The result of app verison existed (Boolean)'],
    ['ZEAALOT_ERROR_MESSAGE', 'The error message during upload process']
  ]
end

.return_valueObject



131
132
133
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 131

def self.return_value
  Boolean
end

.run(params) ⇒ Object



15
16
17
18
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 15

def self.run(params)
  response = check_app_version(params)
  parse_response(response, params[:fail_on_error])
end