Skip to content

Commit

Permalink
PR fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Krisztián Gödrei committed Nov 30, 2015
1 parent 54649a1 commit 86d71ab
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion uploaders/ipa_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
# --- upload ipa
# -----------------------

def export_method(mobileprovision_content)
# if ProvisionedDevices: !nil & "get-task-allow": true -> development
# if ProvisionedDevices: !nil & "get-task-allow": false -> ad-hoc
# if ProvisionedDevices: nil & "ProvisionsAllDevices": "true" -> enterprise
# if ProvisionedDevices: nil & ProvisionsAllDevices: nil -> app-store
if mobileprovision_content['ProvisionedDevices'].nil?
return 'enterprise' if !mobileprovision_content['ProvisionsAllDevices'].nil? && (mobileprovision_content['ProvisionsAllDevices'] == true || mobileprovision_content['ProvisionsAllDevices'] == 'true')
return 'app-store'
else
unless mobileprovision_content['Entitlements'].nil?
entitlements = mobileprovision_content['Entitlements']
return 'development' if !entitlements['get-task-allow'].nil? && (entitlements['get-task-allow'] == true || entitlements['get-task-allow'] == 'true')
return 'ad-hoc'
end
end
return 'development'
end

def deploy_ipa_to_bitrise(ipa_path, build_url, api_token, notify_user_groups, notify_emails, is_enable_public_page)
puts
puts "# Deploying ipa file: #{ipa_path}"
Expand All @@ -27,7 +45,7 @@ def deploy_ipa_to_bitrise(ipa_path, build_url, api_token, notify_user_groups, no
parsed_ipa_infos[:mobileprovision] = ipa_analyzer.collect_provision_info
fail 'Failed to collect Provisioning Profile information' if parsed_ipa_infos[:mobileprovision].nil?

if parsed_ipa_infos[:mobileprovision]['ProvisionedDevices'].nil? && parsed_ipa_infos[:mobileprovision]['ProvisionsAllDevices'].nil?
if export_method(parsed_ipa_infos[:mobileprovision]) == 'app-store'
if is_enable_public_page
puts
puts ' (!) is_enable_public_page is set, but public download isn\'t allowed for app-store distributions'
Expand Down

0 comments on commit 86d71ab

Please sign in to comment.