Class: Fastlane::Actions::DeleteFromStorageAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



66
67
68
# File 'lib/fastlane/plugin/saucectl/actions/delete_from_storage_action.rb', line 66

def self.authors
  ["Ian Hamilton"]
end

.available_optionsObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/fastlane/plugin/saucectl/actions/delete_from_storage_action.rb', line 28

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :region,
                                 description: "Data Center region (us or eu), set using: region: 'eu'",
                                 optional: false,
                                 is_string: true,
                                 verify_block: proc do |value|
                                   UI.user_error!(@messages['region_error'].gsub!('$region', value)) if value.empty? || !@messages['supported_regions'].include?(value)
                                 end),
    FastlaneCore::ConfigItem.new(key: :sauce_username,
                                 env_name: "SAUCE_USERNAME",
                                 description: "Your sauce labs username in order to authenticate delete file from app storage",
                                 default_value: Actions.lane_context[SharedValues::SAUCE_USERNAME],
                                 optional: false,
                                 is_string: true,
                                 verify_block: proc do |value|
                                   UI.user_error!(@messages['sauce_username_error']) if value.empty?
                                 end),
    FastlaneCore::ConfigItem.new(key: :sauce_access_key,
                                 env_name: "SAUCE_ACCESS_KEY",
                                 description: "Your sauce labs access key in order to authenticate delete file from app storage",
                                 default_value: Actions.lane_context[SharedValues::SAUCE_ACCESS_KEY],
                                 optional: false,
                                 is_string: true,
                                 verify_block: proc do |value|
                                   UI.user_error!(@messages['sauce_api_key_error']) if value.empty?
                                 end),
    FastlaneCore::ConfigItem.new(key: :app_id,
                                 description: "The application id from sauce labs storage",
                                 optional: true,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :group_id,
                                 description: "The group id for sauce labs storage",
                                 optional: true,
                                 is_string: true)
  ]
end

.categoryObject



70
71
72
# File 'lib/fastlane/plugin/saucectl/actions/delete_from_storage_action.rb', line 70

def self.category
  :testing
end

.descriptionObject



20
21
22
# File 'lib/fastlane/plugin/saucectl/actions/delete_from_storage_action.rb', line 20

def self.description
  "Delete test artifacts from sauce labs storage"
end

.detailsObject



24
25
26
# File 'lib/fastlane/plugin/saucectl/actions/delete_from_storage_action.rb', line 24

def self.details
  "Delete test artifacts from sauce labs storage by storage id or group id"
end

.example_codeObject



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/fastlane/plugin/saucectl/actions/delete_from_storage_action.rb', line 78

def self.example_code
  [
    "delete_from_storage(
      region: 'eu',
      sauce_username: 'sauce username',
      sauce_access_key: 'sauce api name',
      app_id: '1234-1234-1234-1234'
    )",
    "delete_from_storage(
      region: 'eu',
      sauce_username: 'sauce username',
      sauce_access_key: 'sauce api name',
      group_id: '123456789'
    )"
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/fastlane/plugin/saucectl/actions/delete_from_storage_action.rb', line 74

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

.run(params) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/fastlane/plugin/saucectl/actions/delete_from_storage_action.rb', line 12

def self.run(params)
  if params[:group_id].nil?
    Fastlane::Saucectl::Storage.new(params).delete_app_with_file_id
  else
    Fastlane::Saucectl::Storage.new(params).delete_all_apps_for_group_id
  end
end