Class: Fastlane::Actions::AppcircleTestingDistributionAction

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

Class Method Summary collapse

Class Method Details

.ac_login(accessToken) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/fastlane/plugin/appcircle_testing_distribution/actions/appcircle_testing_distribution_action.rb', line 18

def self.(accessToken)
   = `appcircle login --pat #{accessToken}`
  if $?.success?
    UI.success("Logged in to Appcircle successfully.")
  else
    raise "Error executing command of logging to Appcircle. Please make sure you have installed Appcircle CLI and provided a valid access token. For more information, please visit https://docs.appcircle.io/appcircle-api/api-authentication#generatingmanaging-the-personal-api-tokens #{}"
  end
end

.ac_upload(appPath, profileID, message) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/fastlane/plugin/appcircle_testing_distribution/actions/appcircle_testing_distribution_action.rb', line 27

def self.ac_upload(appPath, profileID, message)
  ac_upload = `appcircle testing-distribution upload --app=#{appPath} --distProfileId=#{profileID} --message "#{message}"`;
  if $?.success?
    UI.success("#{appPath} Uploaded to Appcircle successfully.")
  else
    raise "Error executing command of uploading to Appcircle. Please make sure you have provide the valid app path and distribution profile id. For more information\n" + ac_upload
  end
end

.authorsObject



40
41
42
# File 'lib/fastlane/plugin/appcircle_testing_distribution/actions/appcircle_testing_distribution_action.rb', line 40

def self.authors
  ["appcircleio"]
end

.available_optionsObject



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
# File 'lib/fastlane/plugin/appcircle_testing_distribution/actions/appcircle_testing_distribution_action.rb', line 53

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :accessToken,
                            env_name: "AC_ACCESS_TOKEN",
                         description: "Provide the Appcircle access token to authenticate connections to Appcircle services. This token allows your Azure DevOps pipeline to interact with Appcircle for distributing applications",
                            optional: false,
                                type: String),

    FastlaneCore::ConfigItem.new(key: :profileID,
                            env_name: "AC_PROFILE_ID",
                         description: "Enter the ID of the Appcircle distribution profile. This ID uniquely identifies the profile under which your applications will be distributed",
                            optional: false,
                                type: String),

    FastlaneCore::ConfigItem.new(key: :appPath,
                            env_name: "AC_APP_PATH",
                         description: "Specify the path to your application file. For iOS, this can be a .ipa or .xcarchive file path. For Android, specify the .apk or .appbundle file path",
                            optional: false,
                                type: String),
                                
    FastlaneCore::ConfigItem.new(key: :message,
                            env_name: "AC_MESSAGE",
                         description: "Optional message to include with the distribution to provide additional information to testers or users receiving the build",
                            optional: false,
                                type: String),
  ]
end

.descriptionObject



36
37
38
# File 'lib/fastlane/plugin/appcircle_testing_distribution/actions/appcircle_testing_distribution_action.rb', line 36

def self.description
  "Efficiently distribute application builds to users or testing groups using Appcircle's robust platform."
end

.detailsObject



48
49
50
51
# File 'lib/fastlane/plugin/appcircle_testing_distribution/actions/appcircle_testing_distribution_action.rb', line 48

def self.details
  # Optional:
  "Appcircle simplifies the distribution of builds to test teams with an extensive platform for managing and tracking applications, versions, testers, and teams. Appcircle integrates with enterprise authentication mechanisms such as LDAP and SSO, ensuring secure distribution of testing packages. Learn more about Appcircle testing distribution"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


81
82
83
84
85
86
# File 'lib/fastlane/plugin/appcircle_testing_distribution/actions/appcircle_testing_distribution_action.rb', line 81

def self.is_supported?(platform)
  # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
  # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
  #
  [:ios, :android].include?(platform)
end

.return_valueObject



44
45
46
# File 'lib/fastlane/plugin/appcircle_testing_distribution/actions/appcircle_testing_distribution_action.rb', line 44

def self.return_value
  # If your method provides a return value, you can describe here what it does
end

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/fastlane/plugin/appcircle_testing_distribution/actions/appcircle_testing_distribution_action.rb', line 7

def self.run(params)
  accessToken = params[:accessToken]
  profileID = params[:profileID]
  appPath = params[:appPath]
  message = params[:message]

  self.(accessToken)
  self.ac_upload(appPath, profileID, message)

end