Class: Fastlane::Actions::SentryUploadSnapshotsAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



58
59
60
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 58

def self.authors
  ["sentry"]
end

.available_optionsObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 39

def self.available_options
  Helper::SentryConfig.common_api_config_items + [
    FastlaneCore::ConfigItem.new(key: :path,
                                 description: "Path to the folder containing snapshot images",
                                 optional: false,
                                 verify_block: proc do |value|
                                                 UI.user_error! "Could not find path '#{value}'" unless File.exist?(value)
                                                 UI.user_error! "Path is not a directory: '#{value}'" unless File.directory?(value)
                                               end),
    FastlaneCore::ConfigItem.new(key: :app_id,
                                 description: "Application identifier",
                                 optional: false)
  ] + Helper::SentryConfig.common_vcs_config_items
end

.descriptionObject



31
32
33
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 31

def self.description
  "Upload snapshot images to Sentry (EXPERIMENTAL)"
end

.detailsObject



35
36
37
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 35

def self.details
  "This action allows you to upload snapshot images to Sentry to check for visual regressions. NOTE: This features is experimental and might be changed in future releases."
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 62

def self.is_supported?(platform)
  [:ios, :android].include?(platform)
end

.return_valueObject



54
55
56
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 54

def self.return_value
  nil
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 4

def self.run(params)
  Helper::SentryConfig.parse_api_params(params)

  path = params[:path]
  app_id = params[:app_id]

  UI.user_error!("Path does not exist: #{path}") unless File.exist?(path)
  UI.user_error!("Path is not a directory: #{path}") unless File.directory?(path)

  command = [
    "build",
    "snapshots",
    "--app-id",
    app_id,
    path
  ]

  Helper::SentryConfig.build_vcs_command(command, params)

  Helper::SentryHelper.call_sentry_cli(params, command)
  UI.success("Successfully uploaded snapshots!")
end