-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstep.rb
36 lines (28 loc) · 1.11 KB
/
step.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require "#{__dir__}/resigner"
begin
distribution_type = ENV['distribution_type']
ipa_path = ENV['ipa_path']
team_id = ENV['itunes_connect_team_id']
app_id_prefix = ENV['app_id_prefix']
puts "\e[31mThis step is deprecated, please use export-xcarchive step instead\e[0m"
puts "\e[31mWill be removed by: 2017.10.01\e[0m"
puts 'Configs:'
puts " * ipa_path: #{ipa_path}"
puts " * distribution_type: #{distribution_type}"
puts " * team_id: #{team_id}"
puts " * app_id_prefix: #{app_id_prefix}"
puts
raise 'distribution_type is not set' unless distribution_type
raise 'invalid distribution type' unless %w(appstore inhouse development).include?(distribution_type.downcase)
raise 'ipa_path is not set' unless ipa_path
raise 'File not found at ipa_path' unless File.exist?(ipa_path)
team_id = nil if ENV['itunes_connect_team_id'].to_s.eql?('')
app_id_prefix = nil if ENV['app_id_prefix'].to_s.eql?('')
resigner = Resigner.new
resigner.resign(distribution_type, ipa_path, team_id, app_id_prefix)
rescue => ex
puts "\e[31mError: #{ex}\e[0"
puts "\e[31mFailed to resign ipa\e[0m"
puts ex.backtrace
exit 1
end