Class: Fastlane::Actions::MsCredentialsAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



25
26
27
# File 'lib/fastlane/plugin/sapfire/actions/ms_credentials_action.rb', line 25

def self.authors
  ["CheeryLee"]
end

.available_optionsObject



43
44
45
46
47
48
49
50
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
# File 'lib/fastlane/plugin/sapfire/actions/ms_credentials_action.rb', line 43

def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :username,
      env_name: "SF_MS_USERNAME",
      description: "The username of Azure AD account",
      optional: false,
      type: String,
      verify_block: proc do |value|
        UI.user_error!("Microsoft username can't be empty") unless value && !value.empty?
      end
    ),
    FastlaneCore::ConfigItem.new(
      key: :password,
      env_name: "SF_MS_PASSWORD",
      description: "The password of Azure AD account",
      optional: false,
      type: String,
      verify_block: proc do |value|
        UI.user_error!("Microsoft password can't be empty") unless value && !value.empty?
      end
    ),
    FastlaneCore::ConfigItem.new(
      key: :tenant_id,
      env_name: "SF_MS_TENANT_ID",
      description: "The unique identifier of the Azure AD instance",
      optional: false,
      type: String,
      verify_block: proc do |value|
        UI.user_error!("Tenant ID can't be empty") unless value && !value.empty?
      end
    ),
    FastlaneCore::ConfigItem.new(
      key: :client_id,
      env_name: "SF_MS_CLIENT_ID",
      description: "The ID of an application that would be associate to get working with Microsoft account",
      optional: false,
      type: String,
      verify_block: proc do |value|
        UI.user_error!("Client ID can't be empty") unless value && !value.empty?
      end
    ),
    FastlaneCore::ConfigItem.new(
      key: :client_secret,
      env_name: "SF_MS_CLIENT_SECRET",
      description: "The unique secret string of an application that can be generated in Microsoft Partner Center",
      optional: false,
      type: String,
      verify_block: proc do |value|
        UI.user_error!("Client secret string can't be empty") unless value && !value.empty?
      end
    )
  ]
end

.categoryObject



98
99
100
# File 'lib/fastlane/plugin/sapfire/actions/ms_credentials_action.rb', line 98

def self.category
  :misc
end

.descriptionObject



21
22
23
# File 'lib/fastlane/plugin/sapfire/actions/ms_credentials_action.rb', line 21

def self.description
  "Sets Azure AD account credentials"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/fastlane/plugin/sapfire/actions/ms_credentials_action.rb', line 29

def self.is_supported?(platform)
  [:windows].include?(platform)
end

.outputObject



33
34
35
36
37
38
39
40
41
# File 'lib/fastlane/plugin/sapfire/actions/ms_credentials_action.rb', line 33

def self.output
  [
    ["SF_MS_USERNAME", "The username of Azure AD account"],
    ["SF_MS_PASSWORD", "The password of Azure AD account"],
    ["SF_MS_TENANT_ID", "The unique identifier of the Azure AD instance"],
    ["SF_MS_CLIENT_ID", "The ID of an application that would be associate to get working with Microsoft account"],
    ["SF_MS_CLIENT_SECRET", "The unique secret string of an application that can be generated in Microsoft Partner Center"]
  ]
end

.run(params) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/fastlane/plugin/sapfire/actions/ms_credentials_action.rb', line 11

def self.run(params)
  Helper.ms_credentials.username = params[:username]
  Helper.ms_credentials.password = params[:password]
  Helper.ms_credentials.tenant_id = params[:tenant_id]
  Helper.ms_credentials.client_id = params[:client_id]
  Helper.ms_credentials.client_secret = params[:client_secret]

  UI.success("Credentials for Azure AD account is successfully saved for further actions")
end