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



164
165
166
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 164

def self.authors
  ['icyleaf']
end

.available_optionsObject



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
118
119
120
121
122
123
124
125
126
127
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 70

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: :hide_user_token,
                                 env_name: 'ZEALOT_HIDE_USER_TOKEN',
                                 description: 'replase user token to *** to keep secret',
                                 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



160
161
162
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 160

def self.category
  :beta
end

.descriptionObject



66
67
68
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 66

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

.example_codeObject



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 129

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)


168
169
170
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 168

def self.is_supported?(_)
  true
end

.outputObject



149
150
151
152
153
154
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 149

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



156
157
158
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 156

def self.return_value
  Boolean
end

.run(params) ⇒ Object



23
24
25
26
# File 'lib/fastlane/plugin/zealot/actions/zealot_version_check.rb', line 23

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