21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/xcode_builder/deployment_strategies/hockeyapp.rb', line 21
def deploy
release_notes = get_notes
payload = {
:api_token => @configuration.api_token,
:ipa => File.new(@configuration.ipa_path, 'rb'),
:notes => release_notes,
:status => 2,
:teams => (@configuration.teams || []).join(","),
}
print "Uploading build to HockeyApp..."
statusCode = 0
begin
response = RestClient.post(ENDPOINT, payload, :accept => :json, :'X-HockeyAppToken' => @configuration.api_token)
statusCode = response.code
rescue => e
puts "HockeyApp upload failed with exception:\n#{e}Response\n#{e.response}"
end
if (statusCode == 201) || (statusCode == 200)
puts "Done."
end
end
|