Skip to content

Commit

Permalink
update file name because conflicts with enterprise store plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Guven Karanfil committed Aug 21, 2024
1 parent a85f9e6 commit eb63ec5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
require 'json'

require_relative '../helper/appcircle_testing_distribution_helper'
require_relative '../helper/auth_service'
require_relative '../helper/upload_service'
require_relative '../helper/TDAuthService'
require_relative '../helper/TDUploadService'

module Fastlane
module Actions
Expand Down Expand Up @@ -37,13 +37,13 @@ def self.run(params)

authToken = self.ac_login(accessToken)

profileId = UploadService.get_profile_id(authToken, profileName, createProfileIfNotExists)
profileId = TDUploadService.get_profile_id(authToken, profileName, createProfileIfNotExists)
self.ac_upload(authToken, appPath, profileId, message)
end

def self.ac_login(accessToken)
begin
user = AuthService.get_ac_token(pat: accessToken)
user = TDAuthService.get_ac_token(pat: accessToken)
UI.success("Login is successful.")
return user.accessToken
rescue => e
Expand Down Expand Up @@ -84,7 +84,7 @@ def self.send_request(uri, access_token)

def self.ac_upload(token, appPath, profileID, message)
begin
response = UploadService.upload_artifact(token: token, message: message, app: appPath, dist_profile_id: profileID)
response = TDUploadService.upload_artifact(token: token, message: message, app: appPath, dist_profile_id: profileID)
result = self.checkTaskStatus(token, response['taskId'])

if $?.success? and result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize(accessToken:)
end
end

module AuthService
module TDAuthService
def self.get_ac_token(pat:)
endpoint_url = 'https://auth.appcircle.io/auth/v2/token'
uri = URI(endpoint_url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

BASE_URL = "https://api.appcircle.io"

module UploadService
module TDUploadService
def self.upload_artifact(token:, message:, app:, dist_profile_id:)
url = "https://api.appcircle.io/distribution/v2/profiles/#{dist_profile_id}/app-versions"
headers = {
Expand Down Expand Up @@ -74,7 +74,7 @@ def self.get_profile_id(authToken, profileName, createProfileIfNotExists)
profileId = nil

begin
profiles = UploadService.get_distribution_profiles(auth_token: authToken)
profiles = TDUploadService.get_distribution_profiles(auth_token: authToken)
profiles.each do |profile|
if profile["name"] == profileName
profileId = profile['id']
Expand All @@ -91,7 +91,7 @@ def self.get_profile_id(authToken, profileName, createProfileIfNotExists)
if profileId.nil? && createProfileIfNotExists
begin
puts "The test profile '#{profileName}' could not be found. A new profile is being created..."
new_profile = UploadService.create_distribution_profile(name: profileName, auth_token: authToken)
new_profile = TDUploadService.create_distribution_profile(name: profileName, auth_token: authToken)
if new_profile.nil?
raise "Error: The new profile could not be created."
end
Expand Down

0 comments on commit eb63ec5

Please sign in to comment.