deliver 0.7.13 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/assets/DeliverfileDefault +14 -2
- data/lib/assets/DeliverfileExample +3 -0
- data/lib/deliver/deliver_process.rb +37 -7
- data/lib/deliver/deliverfile/deliverfile_creator.rb +18 -13
- data/lib/deliver/itunes_connect/itunes_connect_app_rating.rb +18 -14
- data/lib/deliver/itunes_connect/itunes_connect_screenshot_fetcher.rb +3 -2
- data/lib/deliver/itunes_transporter.rb +13 -3
- data/lib/deliver/testflight.rb +2 -2
- data/lib/deliver/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e8b78f5d2bd18344f491a53d2d2097137ca6ea5
|
4
|
+
data.tar.gz: a30ebf40d66983d4b1aec2a9050ffe3c33a29223
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5ef73826eb558bd5c47b7ce1d63af2b1f94a980a72769af7b1145444f403edd0fc1e7dbdd5b0e84ccd88148fd5bf367f7ab5824cd82bbd56591f59f2f9c1844
|
7
|
+
data.tar.gz: 5f86527190c1e4457203d97652f4b301716e6b435eb746c20333c866dabc8f94f2c070152903c207d4e52130179eba8fce82b0c945511bfa34fbf8ba63857c23
|
data/README.md
CHANGED
@@ -151,6 +151,9 @@ All available commands with a short description can be found in [Deliverfile.md]
|
|
151
151
|
|
152
152
|
Here are a few examples:
|
153
153
|
#### Upload screenshots to iTunes Connect
|
154
|
+
|
155
|
+
Remove the rest, and use just this format for your ```Deliverfile```.
|
156
|
+
|
154
157
|
```ruby
|
155
158
|
app_identifier "net.sunapps.1"
|
156
159
|
version "1.1"
|
@@ -304,7 +307,7 @@ A detailed description about your credentials is available on a [seperate repo](
|
|
304
307
|
|
305
308
|
`deliver` is fully open source, you can take a look at its source files. 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.
|
306
309
|
|
307
|
-
Before actually uploading anything to iTunes, ```
|
310
|
+
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.
|
308
311
|
|
309
312
|
```deliver``` uses the following techniques under the hood:
|
310
313
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# For more information
|
1
|
+
# For more information visit the GitHub documentation: https://github.com/krausefx/deliver
|
2
2
|
# Everything next to a # is a comment and will be ignored
|
3
3
|
|
4
4
|
# hide_transporter_output # remove the '#' in the beginning of the line, to hide the output while uploading
|
@@ -15,9 +15,16 @@
|
|
15
15
|
screenshots_path "./screenshots/"
|
16
16
|
|
17
17
|
|
18
|
+
# More information about all available options: https://github.com/KrauseFx/deliver/blob/master/Deliverfile.md
|
19
|
+
|
20
|
+
# Both lines are optional if you want to remove them:
|
21
|
+
app_identifier "[[APP_IDENTIFIER]]"
|
22
|
+
apple_id "[[APPLE_ID]]" # This is NOT your Apple login ID, but the App ID of your app
|
23
|
+
email "[[EMAIL]]" # the login email address
|
24
|
+
|
18
25
|
# version '1.2' # you can pass this if you want to verify the version number with the ipa file
|
19
26
|
|
20
|
-
|
27
|
+
# To update the app's description, changelog, etc. or to avoid updating it using deliver, edit the files in ./metadata/[language]
|
21
28
|
|
22
29
|
########################################
|
23
30
|
# Building and Testing
|
@@ -34,6 +41,9 @@ ipa do
|
|
34
41
|
# If you only want to upload app metadata, remove the complete ipa block.
|
35
42
|
|
36
43
|
# system("ipa build --verbose") # build your project using Shenzhen
|
44
|
+
|
45
|
+
# ENV["IPA_OUTPUT_PATH"] # if you're using fastlane uncomment this and remove the line below
|
46
|
+
|
37
47
|
"./[[APP_NAME]].ipa" # Tell 'Deliver' where it can find the finished ipa file
|
38
48
|
end
|
39
49
|
|
@@ -52,3 +62,5 @@ end
|
|
52
62
|
success do
|
53
63
|
# system("say 'Successfully deployed a new version.'")
|
54
64
|
end
|
65
|
+
|
66
|
+
# More information about all available options: https://github.com/KrauseFx/deliver/blob/master/Deliverfile.md
|
@@ -47,6 +47,9 @@ ipa do
|
|
47
47
|
# If you only want to upload app metadata, remove the complete ipa block.
|
48
48
|
|
49
49
|
# system("ipa build --verbose") # build your project using Shenzhen
|
50
|
+
|
51
|
+
# ENV["IPA_OUTPUT_PATH"] # if you're using fastlane uncomment this and remove the line below
|
52
|
+
|
50
53
|
"./[[APP_NAME]].ipa" # Tell 'Deliver' where it can find the finished ipa file
|
51
54
|
end
|
52
55
|
|
@@ -39,7 +39,8 @@ module Deliver
|
|
39
39
|
unless is_beta_build?
|
40
40
|
# App Metdata will not be updated for beta builds
|
41
41
|
|
42
|
-
load_metadata_from_config_json_folder # the json file generated from the quick start
|
42
|
+
load_metadata_from_config_json_folder # the json file generated from the quick start # deprecated
|
43
|
+
load_metadata_folder # this is the new way of defining app metadata
|
43
44
|
set_app_metadata
|
44
45
|
set_screenshots
|
45
46
|
|
@@ -105,6 +106,7 @@ module Deliver
|
|
105
106
|
end
|
106
107
|
if skip_deployment?
|
107
108
|
upload_strategy = Deliver::IPA_UPLOAD_STRATEGY_JUST_UPLOAD
|
109
|
+
Helper.log.info "Skipping submission of app update"
|
108
110
|
end
|
109
111
|
|
110
112
|
@ipa = Deliver::IpaUploader.new(Deliver::App.new, '/tmp/', used_ipa_file, upload_strategy)
|
@@ -139,10 +141,8 @@ module Deliver
|
|
139
141
|
end
|
140
142
|
end
|
141
143
|
|
142
|
-
def
|
143
|
-
|
144
|
-
|
145
|
-
matching = {
|
144
|
+
def options_mapping
|
145
|
+
{
|
146
146
|
'title' => Deliverer::ValKey::TITLE,
|
147
147
|
'description' => Deliverer::ValKey::DESCRIPTION,
|
148
148
|
'version_whats_new' => Deliverer::ValKey::CHANGELOG,
|
@@ -151,6 +151,10 @@ module Deliver
|
|
151
151
|
'software_url' => Deliverer::ValKey::MARKETING_URL,
|
152
152
|
'support_url' => Deliverer::ValKey::SUPPORT_URL
|
153
153
|
}
|
154
|
+
end
|
155
|
+
|
156
|
+
def load_metadata_from_config_json_folder
|
157
|
+
return unless @deploy_information[Deliverer::ValKey::CONFIG_JSON_FOLDER]
|
154
158
|
|
155
159
|
file_path = @deploy_information[:config_json_folder]
|
156
160
|
unless file_path.split("/").last.include?"metadata.json"
|
@@ -162,7 +166,7 @@ module Deliver
|
|
162
166
|
content = JSON.parse(File.read(file_path))
|
163
167
|
content.each do |language, current|
|
164
168
|
|
165
|
-
|
169
|
+
options_mapping.each do |key, value|
|
166
170
|
if current[key]
|
167
171
|
@deploy_information[value] ||= {}
|
168
172
|
@deploy_information[value][language] ||= current[key]
|
@@ -171,6 +175,26 @@ module Deliver
|
|
171
175
|
end
|
172
176
|
end
|
173
177
|
|
178
|
+
def load_metadata_folder
|
179
|
+
# Fetch the inforamtion from the ./metadata folder if it exists
|
180
|
+
metadata_folder = './metadata'
|
181
|
+
return unless File.exists?metadata_folder
|
182
|
+
|
183
|
+
Dir[File.join(metadata_folder, '*')].each do |language_folder|
|
184
|
+
language = File.basename(language_folder)
|
185
|
+
|
186
|
+
options_mapping.each do |key, value|
|
187
|
+
content = File.read(File.join(language_folder, "#{key}.txt")) rescue nil
|
188
|
+
next unless content
|
189
|
+
content = content.split("\n") if key == 'keywords'
|
190
|
+
@deploy_information[value] ||= {}
|
191
|
+
@deploy_information[value][language] ||= content
|
192
|
+
|
193
|
+
Helper.log.info "Successfully loaded content from '#{key}.txt' for language #{language_folder}"
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
174
198
|
def set_app_metadata
|
175
199
|
@app.metadata.update_title(@deploy_information[Deliverer::ValKey::TITLE]) if @deploy_information[Deliverer::ValKey::TITLE]
|
176
200
|
@app.metadata.update_description(@deploy_information[Deliverer::ValKey::DESCRIPTION]) if @deploy_information[Deliverer::ValKey::DESCRIPTION]
|
@@ -227,7 +251,13 @@ module Deliver
|
|
227
251
|
|
228
252
|
system("open '#{pdf_path}'")
|
229
253
|
okay = agree("Does the PDF on path '#{pdf_path}' look okay for you? (blue = updated) (y/n)", true)
|
230
|
-
|
254
|
+
|
255
|
+
unless okay
|
256
|
+
dir ||= app.get_metadata_directory
|
257
|
+
dir += "/#{app.apple_id}.itmsp"
|
258
|
+
FileUtils.rm_rf(dir) unless Helper.is_test?
|
259
|
+
raise "Did not upload the metadata, because the PDF file was rejected by the user".yellow
|
260
|
+
end
|
231
261
|
end
|
232
262
|
end
|
233
263
|
end
|
@@ -7,7 +7,7 @@ module Deliver
|
|
7
7
|
class DeliverfileCreator
|
8
8
|
|
9
9
|
# This method will ask the user what he wants to do
|
10
|
-
# @param deliver_path (String) The path in which the Deliverfile should be created
|
10
|
+
# @param deliver_path (String) The path in which the Deliverfile should be created (this automatically takes care if it's in the fastlane folder)
|
11
11
|
# @param project_name (String) The default name of the project, which is used in the generated Deliverfile
|
12
12
|
def self.create(deliver_path, project_name = nil)
|
13
13
|
deliver_file_path = File.join(deliver_path, Deliver::Deliverfile::Deliverfile::FILE_NAME)
|
@@ -58,15 +58,16 @@ module Deliver
|
|
58
58
|
app.set_metadata_directory("/tmp") # we don't want to pollute the current folder
|
59
59
|
app.metadata # this will download the latest app metadata
|
60
60
|
|
61
|
-
file_path =
|
61
|
+
file_path = File.join(deliver_path, Deliver::Deliverfile::Deliverfile::FILE_NAME)
|
62
62
|
json = generate_deliver_file(app, deliver_path, project_name)
|
63
63
|
File.write(file_path, json)
|
64
64
|
|
65
|
-
FileUtils.mkdir_p '
|
65
|
+
FileUtils.mkdir_p File.join(deliver_path, 'screenshots')
|
66
66
|
begin
|
67
67
|
Helper.log.info "Downloading all previously used app screenshots.".green
|
68
|
-
ItunesConnect.new.download_existing_screenshots(app)
|
69
|
-
rescue
|
68
|
+
ItunesConnect.new.download_existing_screenshots(app, deliver_path)
|
69
|
+
rescue Exception => ex
|
70
|
+
Helper.log.error ex
|
70
71
|
Helper.log.error "Couldn't download already existing screenshots from iTunesConnect. You have to add them manually!".red
|
71
72
|
end
|
72
73
|
|
@@ -81,18 +82,22 @@ module Deliver
|
|
81
82
|
# This method takes care of creating a new 'deliver' folder, containg the app metadata
|
82
83
|
# and screenshots folders
|
83
84
|
def self.generate_deliver_file(app, path, project_name)
|
84
|
-
|
85
|
-
FileUtils.mkdir_p metadata_path rescue nil # never mind if it's already there
|
85
|
+
FileUtils.mkdir_p path rescue nil # never mind if it's already there
|
86
86
|
|
87
|
-
json = create_json_based_on_xml(app,
|
87
|
+
json = create_json_based_on_xml(app, path)
|
88
88
|
|
89
|
-
json.each do |
|
90
|
-
|
89
|
+
json.each do |language, value|
|
90
|
+
folder = File.join(path, "metadata", language)
|
91
|
+
FileUtils.mkdir_p(folder)
|
92
|
+
value.each do |key, content|
|
93
|
+
next if key == :version_whats_new
|
94
|
+
content = content.join("\n") if key == :keywords
|
95
|
+
File.write(File.join(folder, "#{key}.txt"), content)
|
96
|
+
end
|
97
|
+
Helper.log.info "Successfully downloaded existing metadata for language #{language}"
|
91
98
|
end
|
92
99
|
|
93
|
-
|
94
|
-
File.write(meta_path, JSON.pretty_generate(json))
|
95
|
-
puts "Successfully created new metadata JSON file at '#{meta_path}'".green
|
100
|
+
puts "Successfully created new configuration files at '#{File.join(path, 'metadata')}'".green
|
96
101
|
|
97
102
|
gem_path = Helper.gem_path('deliver')
|
98
103
|
|
@@ -39,21 +39,25 @@ module Deliver
|
|
39
39
|
|
40
40
|
|
41
41
|
# Apple, doing some extra thingy for the kids section
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
if
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
42
|
+
begin
|
43
|
+
val = config.last['level'].to_i
|
44
|
+
currently_enabled = (all("div[itc-checkbox='tempPageContent.ratingDialog.madeForKidsChecked'] > * > input").last.value != "")
|
45
|
+
Helper.log.info "Setting kids mode to #{val}".green
|
46
|
+
if val > 0
|
47
|
+
if not currently_enabled
|
48
|
+
all("div[itc-checkbox='tempPageContent.ratingDialog.madeForKidsChecked'] > * > a").last.click
|
49
|
+
end
|
50
|
+
|
51
|
+
# Kids is enabled, check mode
|
52
|
+
first("select[ng-model='tempRatings.ageBand'] > option[value='#{val - 1}']").select_option # -1 since 0 is no kids mode
|
53
|
+
else
|
54
|
+
if currently_enabled
|
55
|
+
# disable kids mode
|
56
|
+
all("div[itc-checkbox='tempPageContent.ratingDialog.madeForKidsChecked'] > * > a").last.click
|
57
|
+
end
|
56
58
|
end
|
59
|
+
rescue
|
60
|
+
Helper.log.warn "Couldn't set kids mode because of other options."
|
57
61
|
end
|
58
62
|
|
59
63
|
# Check if there is a warning or error message because of this rating
|
@@ -7,10 +7,11 @@ module Deliver
|
|
7
7
|
|
8
8
|
# This method will download all existing app screenshots
|
9
9
|
# @param app (Deliver::App) the app you want this information from
|
10
|
+
# @param folder_path (String) the path to store the screenshots in
|
10
11
|
# @raise [ItunesConnectGeneralError] General error while executing
|
11
12
|
# this action
|
12
13
|
# @raise [ItunesConnectLoginError] Login data is wrong
|
13
|
-
def download_existing_screenshots(app)
|
14
|
+
def download_existing_screenshots(app, folder_path)
|
14
15
|
languages = JSON.parse(File.read(File.join(Helper.gem_path('deliver'), "lib", "assets", "DeliverLanguageMapping.json")))
|
15
16
|
|
16
17
|
begin
|
@@ -40,7 +41,7 @@ module Deliver
|
|
40
41
|
file_name = [screenshot['value']['sortOrder'], type, screenshot['value']['originalFileName']].join("_")
|
41
42
|
Helper.log.info "Downloading existing screenshot '#{file_name}' of device type: '#{type}'"
|
42
43
|
|
43
|
-
containing_folder = File.join(
|
44
|
+
containing_folder = File.join(folder_path, "screenshots", language_code)
|
44
45
|
FileUtils.mkdir_p containing_folder rescue nil # if it's already there
|
45
46
|
path = File.join(containing_folder, file_name)
|
46
47
|
File.write(path, open(url).read)
|
@@ -18,7 +18,9 @@ module Deliver
|
|
18
18
|
OUTPUT_REGEX = />\s+(.+)/
|
19
19
|
RETURN_VALUE_REGEX = />\sDBG-X:\sReturning\s+(\d+)/
|
20
20
|
|
21
|
-
|
21
|
+
SKIP_ERRORS = [ "ERROR: An exception has occurred: Scheduling automatic restart in 1 minute" ]
|
22
|
+
|
23
|
+
private_constant :ERROR_REGEX, :WARNING_REGEX, :OUTPUT_REGEX, :RETURN_VALUE_REGEX, :SKIP_ERRORS
|
22
24
|
|
23
25
|
# This will be called from the Deliverfile, and disables the logging of the transporter output
|
24
26
|
def self.hide_transporter_output
|
@@ -54,7 +56,10 @@ module Deliver
|
|
54
56
|
if result and File.directory?itmsp_path
|
55
57
|
Helper.log.info "Successfully downloaded the latest package from iTunesConnect.".green
|
56
58
|
else
|
57
|
-
|
59
|
+
unless /^[0-9a-zA-Z\.\$\_]*$/ === @password
|
60
|
+
Helper.log.fatal "Password contains special characters, which may not be handled properly by iTMSTransporter. If you experience problems uploading to iTunes Connect, please consider changing your password to something with only alphanumeric characters.".red
|
61
|
+
end
|
62
|
+
Helper.log.fatal "Could not download metadata from iTunes Connect! It's probably related to your password or your internet connection."
|
58
63
|
end
|
59
64
|
|
60
65
|
result
|
@@ -128,7 +133,12 @@ module Deliver
|
|
128
133
|
# Taken from https://github.com/sshaw/itunes_store_transporter/blob/master/lib/itunes/store/transporter/output_parser.rb
|
129
134
|
|
130
135
|
output_done = false
|
131
|
-
|
136
|
+
|
137
|
+
re = Regexp.union(SKIP_ERRORS)
|
138
|
+
if line.match(re)
|
139
|
+
# Those lines will not be handle like errors or warnings
|
140
|
+
|
141
|
+
elsif line =~ ERROR_REGEX
|
132
142
|
@errors << $1
|
133
143
|
Helper.log.error "[Transporter Error Output]: #{$1}".red
|
134
144
|
|
data/lib/deliver/testflight.rb
CHANGED
@@ -9,9 +9,9 @@ module Deliver
|
|
9
9
|
ItunesTransporter.hide_transporter_output
|
10
10
|
|
11
11
|
app_identifier = IpaFileAnalyser.fetch_app_identifier(ipa_path)
|
12
|
-
app_identifier ||= ask("Could not automatically find the app identifier, please enter the app's bundle identifier: ")
|
12
|
+
app_identifier ||= ENV["TESTFLIGHT_APP_IDENTITIFER"] || ask("Could not automatically find the app identifier, please enter the app's bundle identifier: ")
|
13
13
|
app_id ||= (Deliver::ItunesSearchApi.fetch_by_identifier(app_identifier)['trackId'] rescue nil)
|
14
|
-
app_id ||= ask("Could not automatically find the app ID, please enter it here (e.g. 956814360): ")
|
14
|
+
app_id ||= ENV["TESTFLIGHT_APPLE_ID"] || ask("Could not automatically find the app ID, please enter it here (e.g. 956814360): ")
|
15
15
|
strategy = (skip_deploy ? Deliver::IPA_UPLOAD_STRATEGY_JUST_UPLOAD : Deliver::IPA_UPLOAD_STRATEGY_BETA_BUILD)
|
16
16
|
|
17
17
|
Helper.log.info "Ready to upload new build to TestFlight (#{app_identifier} - #{app_id})".green
|
data/lib/deliver/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deliver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane_core
|