deliver 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +37 -10
  3. data/.rspec +1 -0
  4. data/.travis.yml +8 -0
  5. data/.yardopts +1 -0
  6. data/Gemfile.lock +106 -0
  7. data/LICENSE +21 -0
  8. data/README.md +268 -17
  9. data/Rakefile +3 -0
  10. data/assets/PDFExample.png +0 -0
  11. data/assets/SubmitForReviewInformation.png +0 -0
  12. data/assets/deliver.png +0 -0
  13. data/assets/deliver.pxm +0 -0
  14. data/assets/deliverFullSize.png +0 -0
  15. data/bin/deliver +32 -0
  16. data/deliver.gemspec +15 -9
  17. data/lib/assets/DeliverfileDefault +47 -0
  18. data/lib/assets/DeliverfileExample +62 -0
  19. data/lib/assets/ScreenshotsHelp +4 -0
  20. data/lib/deliver.rb +20 -1
  21. data/lib/deliver/app.rb +146 -0
  22. data/lib/deliver/app_metadata.rb +487 -0
  23. data/lib/deliver/app_screenshot.rb +119 -0
  24. data/lib/deliver/commands.rb +4 -0
  25. data/lib/deliver/commands/init.rb +12 -0
  26. data/lib/deliver/commands/run.rb +20 -0
  27. data/lib/deliver/deliver_process.rb +241 -0
  28. data/lib/deliver/deliverer.rb +112 -0
  29. data/lib/deliver/deliverfile/deliverfile.rb +35 -0
  30. data/lib/deliver/deliverfile/deliverfile_creator.rb +115 -0
  31. data/lib/deliver/deliverfile/dsl.rb +124 -0
  32. data/lib/deliver/dependency_checker.rb +32 -0
  33. data/lib/deliver/helper.rb +55 -0
  34. data/lib/deliver/ipa_uploader.rb +160 -0
  35. data/lib/deliver/itunes_connect.rb +514 -0
  36. data/lib/deliver/itunes_search_api.rb +48 -0
  37. data/lib/deliver/itunes_transporter.rb +154 -0
  38. data/lib/deliver/languages.rb +6 -0
  39. data/lib/deliver/metadata_item.rb +94 -0
  40. data/lib/deliver/password_manager.rb +86 -0
  41. data/lib/deliver/pdf_generator.rb +131 -0
  42. data/lib/deliver/version.rb +1 -1
  43. data/spec/app_metadata_spec.rb +350 -0
  44. data/spec/app_screenshot_spec.rb +88 -0
  45. data/spec/app_spec.rb +85 -0
  46. data/spec/deliverer_spec.rb +48 -0
  47. data/spec/deliverfile_creator_spec.rb +73 -0
  48. data/spec/example_deliver_files_spec.rb +227 -0
  49. data/spec/fixtures/Deliverfiles/DeliverfileCallbacks +14 -0
  50. data/spec/fixtures/Deliverfiles/DeliverfileCallbacksFailingTests +14 -0
  51. data/spec/fixtures/Deliverfiles/DeliverfileCallbacksNoErrorBlock +6 -0
  52. data/spec/fixtures/Deliverfiles/DeliverfileDefaultLanguageNotOnTop +8 -0
  53. data/spec/fixtures/Deliverfiles/DeliverfileDuplicateIpa +2 -0
  54. data/spec/fixtures/Deliverfiles/DeliverfileLocales +16 -0
  55. data/spec/fixtures/Deliverfiles/DeliverfileMetadataJson +6 -0
  56. data/spec/fixtures/Deliverfiles/DeliverfileMissingAppVersion +1 -0
  57. data/spec/fixtures/Deliverfiles/DeliverfileMissingBlockForTests +7 -0
  58. data/spec/fixtures/Deliverfiles/DeliverfileMissingIdentifier +1 -0
  59. data/spec/fixtures/Deliverfiles/DeliverfileMissingLanguage +1 -0
  60. data/spec/fixtures/Deliverfiles/DeliverfileMissingValue +3 -0
  61. data/spec/fixtures/Deliverfiles/DeliverfileMixed +37 -0
  62. data/spec/fixtures/Deliverfiles/DeliverfileNoVersion +3 -0
  63. data/spec/fixtures/Deliverfiles/DeliverfileScreenshots +6 -0
  64. data/spec/fixtures/Deliverfiles/DeliverfileScreenshotsFallbackDefaultLanguage +7 -0
  65. data/spec/fixtures/Deliverfiles/DeliverfileSimple +8 -0
  66. data/spec/fixtures/Deliverfiles/DeliverfileVersionMismatchPackage +8 -0
  67. data/spec/fixtures/Deliverfiles/DeliverfileWrongIdentifier +5 -0
  68. data/spec/fixtures/Deliverfiles/DeliverfileWrongVersion +5 -0
  69. data/spec/fixtures/Deliverfiles/metadata.json +24 -0
  70. data/spec/fixtures/example1.itmsp/metadata.xml +121 -0
  71. data/spec/fixtures/example2.itmsp/metadata.xml +54 -0
  72. data/spec/fixtures/ipas/Example1.ipa +0 -0
  73. data/spec/fixtures/metadata/ipa_result.xml +12 -0
  74. data/spec/fixtures/metadata/ipa_result2.xml +12 -0
  75. data/spec/fixtures/packages/464686641.itmsp/metadata.xml +104 -0
  76. data/spec/fixtures/packages/794902327.itmsp/metadata.xml +107 -0
  77. data/spec/fixtures/packages/878567776.itmsp/metadata.xml +104 -0
  78. data/spec/fixtures/screenshots/de-DE/iPhone4.png +0 -0
  79. data/spec/fixtures/screenshots/de-DE/iPhone6.png +0 -0
  80. data/spec/fixtures/screenshots/de-DE/iPhone6Plus1.png +0 -0
  81. data/spec/fixtures/screenshots/de-DE/iPhone6Plus2.png +0 -0
  82. data/spec/fixtures/screenshots/de-DE/screenshot1.png +0 -0
  83. data/spec/fixtures/screenshots/de-DE/screenshot2.png +0 -0
  84. data/spec/fixtures/screenshots/de-DE/screenshot3.png +0 -0
  85. data/spec/fixtures/screenshots/de-DE/screenshot5.png +0 -0
  86. data/spec/fixtures/screenshots/en-US/english.png +0 -0
  87. data/spec/fixtures/screenshots/iPhone4.png +0 -0
  88. data/spec/fixtures/screenshots/invalidImage.png +0 -0
  89. data/spec/fixtures/screenshots/screenshot1.png +0 -0
  90. data/spec/fixtures/screenshots/tooMany/de-DE/iPhone4 2.png +0 -0
  91. data/spec/fixtures/screenshots/tooMany/de-DE/iPhone4 copy 2.png +0 -0
  92. data/spec/fixtures/screenshots/tooMany/de-DE/iPhone4 copy 3.png +0 -0
  93. data/spec/fixtures/screenshots/tooMany/de-DE/iPhone4 copy 4.png +0 -0
  94. data/spec/fixtures/screenshots/tooMany/de-DE/iPhone4 copy 5.png +0 -0
  95. data/spec/fixtures/screenshots/tooMany/de-DE/iPhone4 copy 6.png +0 -0
  96. data/spec/fixtures/screenshots/tooMany/de-DE/iPhone4 copy.png +0 -0
  97. data/spec/fixtures/screenshots/tooMany/de-DE/iPhone4.png +0 -0
  98. data/spec/helper_spec.rb +16 -0
  99. data/spec/ipa_uploader_spec.rb +61 -0
  100. data/spec/itunes_connect_spec.rb +12 -0
  101. data/spec/itunes_search_api_spec.rb +24 -0
  102. data/spec/itunes_transporter_spec.rb +52 -0
  103. data/spec/languages_spec.rb +7 -0
  104. data/spec/metadata_item_spec.rb +36 -0
  105. data/spec/mocking/transporter_mocking.rb +40 -0
  106. data/spec/mocking/webmocking.rb +31 -0
  107. data/spec/password_manager_spec.rb +27 -0
  108. data/spec/responses/itunesLookup-.json +4 -0
  109. data/spec/responses/itunesLookup-0.json +4 -0
  110. data/spec/responses/itunesLookup-284882215.json +106 -0
  111. data/spec/responses/itunesLookup-at.felixkrause.iTanky.json +8 -0
  112. data/spec/responses/itunesLookup-com.facebook.Facebook.json +106 -0
  113. data/spec/responses/itunesLookup-invalid.json +4 -0
  114. data/spec/responses/itunesLookup-net.sunapps.invalid.json +4 -0
  115. data/spec/responses/transporter/download_invalid_apple_id.txt +35 -0
  116. data/spec/responses/transporter/download_valid_apple_id.txt +32 -0
  117. data/spec/responses/transporter/upload_invalid.txt +174 -0
  118. data/spec/responses/transporter/upload_valid.txt +290 -0
  119. data/spec/spec_helper.rb +23 -0
  120. data/tasks/rspec.rake +3 -0
  121. metadata +242 -8
  122. data/LICENSE.txt +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9cf9d0d6bc0c0d4cb2829822d1296f9722705925
4
- data.tar.gz: eeab2bb2a145a70c4cf59396e8f99540778ab133
3
+ metadata.gz: 77e02a8f6feb80bae0a16fdabf54c64acd06a623
4
+ data.tar.gz: 9bb9aba97c0df9dbc335f5620a5c3750561e032a
5
5
  SHA512:
6
- metadata.gz: 5f1896ded2fe952ad1f36ac6ba49e24c38d67c738ab5525dd69cd00d7a48db6529aa5dc1bf8b8e3d69fd1d5bc3ed89ff599cfa1ab075ba194229cda163fdcae1
7
- data.tar.gz: cb890cb61ef86bce2374b887b76aa58167d8f59d2df6cb82e0c3e0bae97a66adba1f57dc527d8dd0f86461fdc224bce2a90a1011122237723f67dbe34678492c
6
+ metadata.gz: e41f03ced1bcc54b3492b60762e4c1c192e60d3542495abead4271b63cf9c4ace344852293a6aece1bdc510a6041d34c32491efad9ab2961c53f72e1a6eec1ce
7
+ data.tar.gz: 08fd2506399710df17ef6bedc00ea008ab0da394934ccb8d8d3d7b9e2c38015b5deb62540fa818d31b1df29cc3b6ea28c69c7810b93d01afde155ca808a01519
data/.gitignore CHANGED
@@ -1,14 +1,41 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
1
+ *.gem
2
+ *.rbc
3
+ /.config
5
4
  /coverage/
6
- /doc/
5
+ /InstalledFiles
7
6
  /pkg/
8
7
  /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
9
10
  /tmp/
10
- *.bundle
11
- *.so
12
- *.o
13
- *.a
14
- mkmf.log
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
29
+ # Gemfile.lock
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
35
+
36
+
37
+ # Added by Felix
38
+ /*.itmsp
39
+ .idea
40
+ spec/fixtures/*.itmsp/*.png
41
+ /integration
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color --require spec_helper --format d
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ before_install: gem update --system
3
+ rvm:
4
+ - 2.0.0
5
+ - 2.1.0
6
+ addons:
7
+ code_climate:
8
+ repo_token: 260bfcb1b7acf86c3a2424724879c02401d7fc9fc59ac7ca7dfa4b8c39bd1015
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ yardoc --no-private lib/**/*.rb
data/Gemfile.lock ADDED
@@ -0,0 +1,106 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ deliver (0.1.0)
5
+ capybara (~> 2.4.3)
6
+ colored
7
+ commander (~> 4.2.0)
8
+ fastimage (~> 1.6.3)
9
+ highline (~> 1.6.21)
10
+ nokogiri (~> 1.6.3.1)
11
+ plist (~> 3.1.0)
12
+ poltergeist (~> 1.5.1)
13
+ prawn
14
+ rubyzip (~> 1.1.6)
15
+ security (~> 0.1.3)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ addressable (2.3.6)
21
+ capybara (2.4.4)
22
+ mime-types (>= 1.16)
23
+ nokogiri (>= 1.3.3)
24
+ rack (>= 1.0.0)
25
+ rack-test (>= 0.5.4)
26
+ xpath (~> 2.0)
27
+ cliver (0.3.2)
28
+ codeclimate-test-reporter (0.4.1)
29
+ simplecov (>= 0.7.1, < 1.0.0)
30
+ coderay (1.1.0)
31
+ colored (1.2)
32
+ commander (4.2.0)
33
+ highline (~> 1.6.11)
34
+ crack (0.4.2)
35
+ safe_yaml (~> 1.0.0)
36
+ diff-lcs (1.2.5)
37
+ docile (1.1.5)
38
+ fastimage (1.6.3)
39
+ addressable (~> 2.3, >= 2.3.5)
40
+ highline (1.6.21)
41
+ method_source (0.8.2)
42
+ mime-types (2.4.2)
43
+ mini_portile (0.6.0)
44
+ multi_json (1.10.1)
45
+ nokogiri (1.6.3.1)
46
+ mini_portile (= 0.6.0)
47
+ pdf-core (0.4.0)
48
+ plist (3.1.0)
49
+ poltergeist (1.5.1)
50
+ capybara (~> 2.1)
51
+ cliver (~> 0.3.1)
52
+ multi_json (~> 1.0)
53
+ websocket-driver (>= 0.2.0)
54
+ prawn (1.3.0)
55
+ pdf-core (~> 0.4.0)
56
+ ttfunk (~> 1.4.0)
57
+ pry (0.10.1)
58
+ coderay (~> 1.1.0)
59
+ method_source (~> 0.8.1)
60
+ slop (~> 3.4)
61
+ rack (1.5.2)
62
+ rack-test (0.6.2)
63
+ rack (>= 1.0)
64
+ rake (10.3.2)
65
+ rspec (3.1.0)
66
+ rspec-core (~> 3.1.0)
67
+ rspec-expectations (~> 3.1.0)
68
+ rspec-mocks (~> 3.1.0)
69
+ rspec-core (3.1.5)
70
+ rspec-support (~> 3.1.0)
71
+ rspec-expectations (3.1.2)
72
+ diff-lcs (>= 1.2.0, < 2.0)
73
+ rspec-support (~> 3.1.0)
74
+ rspec-mocks (3.1.2)
75
+ rspec-support (~> 3.1.0)
76
+ rspec-support (3.1.1)
77
+ rubyzip (1.1.6)
78
+ safe_yaml (1.0.4)
79
+ security (0.1.3)
80
+ simplecov (0.9.1)
81
+ docile (~> 1.1.0)
82
+ multi_json (~> 1.0)
83
+ simplecov-html (~> 0.8.0)
84
+ simplecov-html (0.8.0)
85
+ slop (3.6.0)
86
+ ttfunk (1.4.0)
87
+ webmock (1.19.0)
88
+ addressable (>= 2.3.6)
89
+ crack (>= 0.3.2)
90
+ websocket-driver (0.3.5)
91
+ xpath (2.0.0)
92
+ nokogiri (~> 1.3)
93
+ yard (0.8.7.4)
94
+
95
+ PLATFORMS
96
+ ruby
97
+
98
+ DEPENDENCIES
99
+ bundler
100
+ codeclimate-test-reporter
101
+ deliver!
102
+ pry
103
+ rake
104
+ rspec (~> 3.1.0)
105
+ webmock (~> 1.19.0)
106
+ yard (~> 0.8.7.4)
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Felix Krause
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,31 +1,282 @@
1
- # Deliver
1
+ <p align="center">
2
+ <img src="assets/deliver.png">
3
+ </p>
2
4
 
3
- TODO: Write a gem description
5
+ Deliver - Continuous Deployment for iOS
6
+ ============
4
7
 
5
- ## Installation
8
+ [![Twitter: @KauseFx](https://img.shields.io/badge/contact-@KrauseFx-blue.svg?style=flat)](https://twitter.com/KrauseFx)
9
+ [![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/KrauseFx/deliver/blob/develop/LICENSE)
10
+ [![Gem](https://img.shields.io/gem/v/deliver.svg?style=flat)](http://rubygems.org/gems/deliver)
11
+ [![Build Status](https://img.shields.io/travis/KrauseFx/deliver/master.svg?style=flat)](https://travis-ci.org/KrauseFx/deliver)
6
12
 
7
- Add this line to your application's Gemfile:
8
13
 
14
+ Updating your iOS app should not be painful and time consuming. Automate the
15
+ whole process to start with Continuous Deployment.
16
+
17
+ ```Deliver``` **can upload ipa files, app screenshots and more to the iTunesConnect backend**, which means, you can deploy new iPhone app updates just by using one command.
18
+
19
+ Follow the developer on Twitter: [@KrauseFx](https://twitter.com/KrauseFx)
20
+
21
+
22
+ -------
23
+ [Features](#features) &bull;
24
+ [Installation](#installation) &bull;
25
+ [Quick Start](#quick-start) &bull;
26
+ [Usage](#usage) &bull;
27
+ [Credentials](#credentials) &bull;
28
+ [Can I trust Deliver?](#can-i-trust-deliver) &bull;
29
+ [Tips](#tips) &bull;
30
+ [Need help?](#need-help)
31
+
32
+ -------
33
+
34
+
35
+ # Features
36
+ - Upload hundreds of screenshots with different languages from different devices
37
+ - Upload a new ipa file to iTunesConnect without Xcode from any computer
38
+ - Update app metadata
39
+ - Easily implement a real Continuous Deployment process
40
+ - Store the configuration in git to easily deploy from **any** computer, including your Continuous Integration server (e.g. Jenkins)
41
+ - Get a PDF preview of the fetched metadata before uploading the app metadata and screenshots to Apple: [Example Preview](https://github.com/krausefx/deliver/blob/master/assets/PDFExample.png?raw=1) (Yes, those are screenshots on taken for all screen sizes)
42
+
43
+ # Installation
44
+
45
+ Install the gem
46
+
47
+ sudo gem install deliver
48
+
49
+ Make sure, you have the latest version of the Xcode command line tools installed:
50
+
51
+ xcode-select --install
52
+
53
+ Install phantomjs (this is needed to control the iTunesConnect frontend)
54
+
55
+ brew update && brew install phantomjs
56
+
57
+ If you don't have homebrew installed already, [install it here](http://brew.sh/).
58
+
59
+ # Quick Start
60
+
61
+
62
+ The guide will create all the necessary files for you, using the existing app metadata from iTunesConnect.
63
+
64
+ - ```cd [your_project_folder]```
65
+ - ```deliver init```
66
+ - When your app is already in the AppStore: ```y```
67
+ - Enter your iTunesConnect credentials
68
+ - Enter your app identifier
69
+ - Enjoy a good drink, while the computer does all the work for you
70
+ - When it's a new app: ```n```
71
+
72
+ Copy your screenshots into the ```deliver/screenshots/[language]``` folders (see [Available language codes](#available-language-codes))
73
+
74
+ From now on, you can run ```deliver``` to deploy a new update, or just upload new app metadata and screenshots.
75
+
76
+ ### Customize the ```Deliverfile```
77
+ Open the ```Deliverfile``` using a text editor and customize it even further. Take a look at the following settings:
78
+
79
+ - ```ipa```: You can either pass a static path to an ipa file, or add your custom build script.
80
+ - ```unit_tests```: Uncomment the code to run tests. (e.g. using [xctool](https://github.com/facebook/xctool))
81
+
82
+ # Usage
83
+
84
+ Why should you have to remember complicated commands and parameters?
85
+
86
+ Store your configuration in a text file to easily deploy from any computer.
87
+
88
+ Run ```deliver init``` to create a new ```Deliverfile```. You can either let the wizard generate a file based on the metadata from iTunesConnect or create one from a template.
89
+
90
+ Once you created your configuration, just run ```deliver```.
91
+
92
+ Here are a few example files:
93
+ #### Upload screenshots to iTunesConnect
9
94
  ```ruby
10
- gem 'deliver'
95
+ app_identifier "net.sunapps.1"
96
+ version "1.1"
97
+
98
+ screenshots_path "./screenshots"
11
99
  ```
100
+ The screenshots folder must include one subfolder per language (see [Available language codes](#available-language-codes))
12
101
 
13
- And then execute:
102
+ #### Upload a new ipa file with a changelog to the AppStore
103
+ This will submit a new update to Apple
104
+ ```ruby
105
+ ipa "./latest.ipa"
106
+ changelog({
107
+ "en-US" => "This update adds cool new features",
108
+ "de-DE" => "Dieses Update ist super"
109
+ })
110
+ ```
14
111
 
15
- $ bundle
16
112
 
17
- Or install it yourself as:
113
+ #### Implement blocks to run unit tests
114
+ ```ruby
115
+ unit_tests do
116
+ system("xctool test")
117
+ end
118
+
119
+ success do
120
+ notifier = Slack::Notifier.new("SlackTeam", "SlackToken")
121
+ notifier.ping "Successfully deployed new version"
122
+ end
123
+
124
+ error do |exception|
125
+ # custom exception handling here
126
+ raise "Something went wrong: #{exception}"
127
+ end
128
+ ```
129
+ For this example I used [slack-notifier](https://github.com/stevenosloan/slack-notifier).
130
+
18
131
 
19
- $ gem install deliver
132
+ #### Set a default language if you are lucky enough to only maintain one language
133
+ ```ruby
134
+ default_language "en-US"
135
+ version "1.2"
136
+
137
+ title "Only English Title"
138
+ ```
139
+ If you do not pass an ipa file, you have to specify the app version you want to edit.
140
+
141
+ #### Update the app's keywords
142
+ ```ruby
143
+ default_language "de-DE"
144
+ version "1.2"
145
+
146
+ keywords ["keyword1", "something", "else"]
147
+ ```
148
+
149
+ #### Read content from somewhere external (file, web service, ...)
150
+ ```ruby
151
+ description({
152
+ "en-US" => File.read("changelog-en.txt")
153
+ "de-DE" => open("http://example.com/latest-changelog.txt").read
154
+ })
155
+ ```
156
+
157
+ #### Build and sign the app
158
+ I'm using [Shenzhen](https://github.com/nomad/shenzhen), but you can use any build tool or custom scripts.
159
+ ```ruby
160
+ ipa do
161
+ # Add any code you want, like incrementing the build
162
+ # number or changing the app identifier
163
+
164
+ system("ipa build") # build your project using Shenzhen
165
+ "./AppName.ipa" # Tell 'Deliver' where it can find the finished ipa file
166
+ end
167
+ ```
168
+
169
+ ##### What is the ```Deliverfile```?
170
+ As you can see, the ```Deliverfile``` is a normal Ruby file, which is executed when
171
+ running a deployment. Therefore it's possible to fully customise the behaviour
172
+ on a deployment.
173
+
174
+ All available commands with a short description can be found in the [wiki](https://github.com/KrauseFx/deliver/wiki/All-available-commands-of-the-Deliverfile).
175
+
176
+ **Some examples:**
177
+
178
+ - Run your own unit tests or integration tests before a deploy (recommended)
179
+ - Ask the script user for a changelog
180
+ - Deploy a new version just by starting a Jenkins job
181
+ - Post the deployment status on Slack
182
+ - Upload the latest screenshots on your server
183
+ - Many more things, be creative and let me know :)
184
+
185
+ #### Use the exposed Ruby classes
186
+ Some examples:
187
+ ```ruby
188
+ require 'deliver'
189
+
190
+ app = Deliver::App.new(app_identifier: 'at.felixkrause.app')
191
+
192
+ app.get_app_status # => Waiting for Review
193
+ app.create_new_version!("1.4")
194
+ app.metadata.update_title({ "en-US" => "iPhone App Title" })
195
+ app.metadata.set_all_screenshots_from_path("./screenshots")
196
+ app.upload_metadata!
197
+ app.itc.submit_for_review!(app)
198
+
199
+ Deliver::ItunesSearchApi.fetch_by_identifier("net.sunapps.15") # => Fetches public metadata
200
+ ```
201
+ This project is well documented, check it out on [Rubydoc](http://www.rubydoc.info/github/KrauseFx/deliver/frames).
202
+
203
+
204
+ # Credentials
205
+
206
+ ## Use the Keychain
207
+ The first time you use *Deliver* you have to enter your iTunesConnect
208
+ credentials. They will be stored in the Keychain.
209
+
210
+ If you decide to remove your
211
+ credentials from the Keychain, just open the *Keychain Access*, select
212
+ *All Items* and search for 'itunesconnect.apple.com'.
213
+
214
+ ## Use environment variables
215
+ You can use the following environment variables to use a specific account instead of the one stored in the keychain:
216
+
217
+ DELIVER_USER
218
+ DELIVER_PASSWORD
219
+
220
+ ## Implement your custom solution
221
+ Take a look at [Using the exposed Ruby classes](use-the-exposed-ruby-classes).
222
+
223
+ # Can I trust *Deliver*?
224
+ ###How does this thing even work? Is magic involved? 🎩###
225
+
226
+ ```Deliver``` is fully open source, you can take a look at it. It will only modify the content you want to modify using the ```Deliverfile```. Your password will be stored in the Mac OS X keychain, but can also be passed using environment variables.
227
+
228
+ Before actually uploading anything to iTunes, ```Deliver``` will generate a [PDF summary](https://github.com/krausefx/deliver/blob/master/assets/PDFExample.png?raw=1) of the collected data.
229
+
230
+ ```Deliver``` uses the following techniques under the hood:
231
+
232
+ - The iTMSTransporter tool is used to fetch the latest app metadata from iTunesConnect and upload the updated app metadata back to Apple. It is also used to upload the ipa file. iTMSTransporter is a command line tool provided by Apple.
233
+ - With the iTMSTransporter you cannot create new version on iTunesConnect or actually publish the newly uploaded ipa file. This is why there is some browser scripting involved, using [Capybara](https://github.com/jnicklas/capybara) and [Poltergeist](https://github.com/teampoltergeist/poltergeist).
234
+ - The iTunes search API to find missing information about a certain app, like the *apple_id* when you only pass the *bundle_identifier*.
235
+
236
+ # Tips
237
+ ## Available language codes
238
+ ```ruby
239
+ ["da-DK", "de-DE", "el-GR", "en-AU", "en-CA", "en-GB", "en-US", "es-ES", "es-MX", "fi-FI", "fr-CA", "fr-FR", "id-ID", "it-IT", "ja-JP", "ko-KR", "ms-MY", "nl-NL", "no-NO", "pt-BR", "pt-PT", "ru-RU", "sv-SE", "th-TH", "tr-TR", "vi-VI", "cmn-Hans", "zh_CN", "cmn-Hant"]
240
+ ```
241
+
242
+ ## Use a clean status bar
243
+ You can use [SimulatorStatusMagic](https://github.com/shinydevelopment/SimulatorStatusMagic) to clean up the status bar.
244
+
245
+ ## Automatically create screenshots
246
+ There is no optimal solution out there (yet).
247
+
248
+ Some open source tools I found helpful:
249
+
250
+ - **[Subliminal](https://github.com/inkling/Subliminal)**: Write your app interaction (e.g. taps) in Objective C. Is based on UIAutomation and is well documented. Currently there are some issues with the latest release of Xcode, which are partly solved in the Xcode6 branch. Checkout my public [gist](https://gist.github.com/KrauseFx/fda87474855dfe0051e6) for running Subliminal on different devices and generating a HTML site viewing all screenshots.
251
+ - **[ui-screen-shooter](https://github.com/jonathanpenn/ui-screen-shooter)**: Makes use of the normal UIAutomation code based on Javascript. The script basically helps you switching the device type and simulator language. It is based on AppleScript.
252
+ - **[rScreenshooter](https://github.com/KrauseFx/rScreenshooter)**: Similar to ui-screen-shooter, but based on Ruby.
253
+
254
+ ```Deliver``` automatically detects the device type of each screenshot based on its resolution. All you have to do is to group the screenshots by their language. Make sure you use the correct language codes.
255
+
256
+ ## Editing the ```Deliverfile```
257
+ Change syntax highlighting to *Ruby*.
258
+
259
+ ## In progress
260
+ These are features, which are implemented, but not yet fully tested and production ready. You can try it on your own risk.
261
+
262
+ #### Distribute an ipa file to your TestFlight beta testers
263
+ ```ruby
264
+ beta_ipa "./latest.ipa"
265
+ ```
266
+ This will upload the ipa file to iTunesConnect and mark the uploaded build as Beta build.
20
267
 
21
- ## Usage
268
+ # Need help?
269
+ - If there is a technical problem with ```Deliver```, submit an issue. Run ```deliver --trace``` to get the stacktrace.
270
+ - I'm available for contract work - drop me an email: deliver@felixkrause.at
22
271
 
23
- TODO: Write usage instructions here
272
+ # License
273
+ This projected is licensed under the terms of the MIT license. See the LICENSE file.
24
274
 
25
- ## Contributing
275
+ # Contributing
26
276
 
27
- 1. Fork it ( https://github.com/[my-github-username]/deliver/fork )
28
- 2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
31
- 5. Create a new Pull Request
277
+ 1. Create an issue to discuss about your idea
278
+ 2. Fork it (https://github.com/KrauseFx/deliver/fork)
279
+ 3. Create your feature branch (`git checkout -b my-new-feature`)
280
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
281
+ 5. Push to the branch (`git push origin my-new-feature`)
282
+ 6. Create a new Pull Request