xcodebuilder 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d694d3926751f843e5e53683edf9dc21b308efa
4
- data.tar.gz: f1249d5ea2b435a4d2db62ff336023eedc7f542f
3
+ metadata.gz: b551eff85cbfd9d99ea5a2ef496b75268ea8ba56
4
+ data.tar.gz: 2b329578fa747f3837375a60633e9a680598eb34
5
5
  SHA512:
6
- metadata.gz: 673bb8bda1bedd277bf0c0df9f29d120f9bd685bdb41607b09e4cb0d843d2f7251610876ad643cc7c3beca5f38fdae4046becc4d9e8fb41b6db8ccdc29645996
7
- data.tar.gz: 3cee04f70382e03e5cee9007b54dc8e1df869501bb54ba51876719f21eaa10960f691b7336633be61e39554386a841c337c55e98b368958393a86aab57cfd52d
6
+ metadata.gz: 86f462491f1e250cbf8e69de24ba4181aa5a6e55e3a3fbf25fd21c8bb98dbf39b16c0b849f3aca22f012b462d93b7a08886182e695bcefcdb3d758de96e8edab
7
+ data.tar.gz: 03c351d06e4d805d3987943c5256fd46789f920c80e133501d67bb7905275182fa4532765d54d7ced1ff5ef43edce6755cce42569a353d46c0ed57efab7d4610
@@ -0,0 +1,81 @@
1
+ require 'rest_client'
2
+ require 'json'
3
+ require 'tmpdir'
4
+ require 'fileutils'
5
+
6
+ module XcodeBuilder
7
+ module DeploymentStrategies
8
+ class HockeyApp < Strategy
9
+ include Rake::DSL
10
+ include FileUtils
11
+ ENDPOINT = "https://rink.hockeyapp.net/api/2/apps/upload"
12
+
13
+ def extended_configuration_for_strategy
14
+ proc do
15
+ def generate_release_notes(&block)
16
+ self.release_notes = block if block
17
+ end
18
+ end
19
+ end
20
+
21
+ def deploy
22
+ release_notes = get_notes
23
+ payload = {
24
+ :api_token => @configuration.api_token,
25
+ :ipa => File.new(@configuration.ipa_path, 'rb'),
26
+ :notes => release_notes,
27
+ :status => 2,
28
+ :teams => (@configuration.teams || []).join(","),
29
+ }
30
+
31
+ print "Uploading build to HockeyApp..."
32
+
33
+ statusCode = 0
34
+ begin
35
+ response = RestClient.post(ENDPOINT, payload, :accept => :json, :'X-HockeyAppToken' => @configuration.api_token)
36
+ statusCode = response.code
37
+ rescue => e
38
+ puts "HockeyApp upload failed with exception:\n#{e}Response\n#{e.response}"
39
+ end
40
+
41
+ if (statusCode == 201) || (statusCode == 200)
42
+ puts "Done."
43
+
44
+ end
45
+ end
46
+
47
+ private
48
+
49
+ def get_notes
50
+ notes = @configuration.release_notes_text
51
+ notes || get_notes_using_editor || get_notes_using_prompt
52
+ end
53
+
54
+ def get_notes_using_editor
55
+ return unless (editor = ENV["EDITOR"])
56
+
57
+ dir = Dir.mktmpdir
58
+ begin
59
+ filepath = "#{dir}/release_notes"
60
+ system("#{editor} #{filepath}")
61
+ @configuration.release_notes = File.read(filepath)
62
+ ensure
63
+ rm_rf(dir)
64
+ end
65
+ end
66
+
67
+ def get_notes_using_prompt
68
+ puts "Enter the release notes for this build (hit enter twice when done):\n"
69
+ @configuration.release_notes = gets_until_match(/\n{2}$/).strip
70
+ end
71
+
72
+ def gets_until_match(pattern, string = "")
73
+ if (string += STDIN.gets) =~ pattern
74
+ string
75
+ else
76
+ gets_until_match(pattern, string)
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
@@ -29,9 +29,11 @@ module XcodeBuilder
29
29
  private
30
30
 
31
31
  def self.strategies
32
- {:testflight => TestFlight}
32
+ {:testflight => TestFlight,
33
+ :hockeyapp => HockeyApp}
33
34
  end
34
35
  end
35
36
  end
36
37
 
37
38
  require File.dirname(__FILE__) + '/deployment_strategies/testflight'
39
+ require File.dirname(__FILE__) + '/deployment_strategies/hockeyapp'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcodebuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Larivain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-02 00:00:00.000000000 Z
11
+ date: 2015-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: CFPropertyList
@@ -109,6 +109,7 @@ files:
109
109
  - README.md
110
110
  - lib/xcode_builder/build_output_parser.rb
111
111
  - lib/xcode_builder/configuration.rb
112
+ - lib/xcode_builder/deployment_strategies/hockeyapp.rb
112
113
  - lib/xcode_builder/deployment_strategies/testflight.rb
113
114
  - lib/xcode_builder/deployment_strategies.rb
114
115
  - lib/xcode_builder/release_strategies/git.rb