Class: Fastlane::Actions::SighAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/sigh.rb

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, details, output, sh, step_text

Class Method Details

.authorObject



50
51
52
# File 'lib/fastlane/actions/sigh.rb', line 50

def self.author
  "KrauseFx"
end

.available_optionsObject



58
59
60
61
# File 'lib/fastlane/actions/sigh.rb', line 58

def self.available_options
  require 'sigh'
  Sigh::Options.available_options
end

.descriptionObject



46
47
48
# File 'lib/fastlane/actions/sigh.rb', line 46

def self.description
  "Generates a provisioning profile. Stores the profile in the current folder"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/fastlane/actions/sigh.rb', line 63

def self.is_supported?(platform)
  platform == :ios
end

.return_valueObject



54
55
56
# File 'lib/fastlane/actions/sigh.rb', line 54

def self.return_value
  "The UDID of the profile sigh just fetched/generated"
end

.run(values) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fastlane/actions/sigh.rb', line 11

def self.run(values)
  require 'sigh'
  require 'credentials_manager/appfile_config'

  begin
    FastlaneCore::UpdateChecker.start_looking_for_update('sigh') unless Helper.is_test?

    Sigh.config = values # we already have the finished config

    path = Sigh::Manager.start

    Actions.lane_context[SharedValues::SIGH_PROFILE_PATH] = path # absolute path
    Actions.lane_context[SharedValues::SIGH_PROFILE_PATHS] ||= []
    Actions.lane_context[SharedValues::SIGH_PROFILE_PATHS] << path
    Actions.lane_context[SharedValues::SIGH_UDID] = ENV["SIGH_UDID"] if ENV["SIGH_UDID"] # The UDID of the new profile

    set_profile_type(values, ENV["SIGH_PROFILE_ENTERPRISE"])

    return ENV["SIGH_UDID"] # return the UDID of the new profile
  ensure
    FastlaneCore::UpdateChecker.show_update_status('sigh', Sigh::VERSION)
  end
end

.set_profile_type(values, enterprise) ⇒ Object



35
36
37
38
39
40
41
42
43
44
# File 'lib/fastlane/actions/sigh.rb', line 35

def self.set_profile_type(values, enterprise)
  profile_type = "app-store"
  profile_type = "ad-hoc" if values[:adhoc]
  profile_type = "development" if values[:development]
  profile_type = "enterprise" if enterprise

  UI.message("Setting Provisioning Profile type to '#{profile_type}'")

  Actions.lane_context[SharedValues::SIGH_PROFILE_TYPE] = profile_type
end