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
|
# File 'lib/dean/commands/upload.rb', line 12
def upload_environment(environment)
configurations = ConfigurationHelper.new().s3_settings_for_environment environment
s3 = AWS::S3.new
bucket = s3.buckets[configurations[:bucket_name]]
version = ProjectVersionHelper.new.version_from_plist environment[:plist]
s3_location = "#{configurations[:bucket_location]}/v#{version}/app.ipa"
ipa_on_s3 = bucket.objects[s3_location]
if ipa_on_s3.exists?
puts "The file already exists on the bucket!"
else
build_settings = ConfigurationHelper.new().build_settings_for_environment environment
disk_location = "#{Dir.pwd}/#{build_settings[:location]}/#{version}/Bizzby.ipa"
puts "Uploading .ipa to #{s3_location}"
ipa_on_s3.write( :file => disk_location)
puts "Uploaded :)"
end
end
|