deliver 0.3.7 → 0.4.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c381ff315b6f8ffd6f8bec88b530ef0b3e0bae1
4
- data.tar.gz: 3406796c4b66bb14021562e09756f5ff04399192
3
+ metadata.gz: 37da57c3eb156d3988937f90351681ab5a21b7af
4
+ data.tar.gz: 99ca18165d2655ed9c71e807a704212b91787c91
5
5
  SHA512:
6
- metadata.gz: 3bf1e5549b91493820f12e73d23aca9cc2ac613f089d0509006212f4a20b2da27a5f2968eff2e819c6d86b7b045120c6509af89bf5748de0ee34d03f03250b6f
7
- data.tar.gz: 311fe5d0275a5c8e40e21da2c9af3dbd286f92b1760b80f6600ccc043fea49b7eb2670d9028cfd988844062afe4d1f769c2fc9034f3562178e4034240416af4d
6
+ metadata.gz: 3965c800ad0007c536e0acdc6f8a05c14cb1196c2b0a7ddc3b1da1ba8ffa9431f64e882b904b814cdae243bb47f802e8e70c761d28ab9cfd59f26a1f4598f593
7
+ data.tar.gz: 8f5d1f9748c7a945aa8ee736c9e17f851f4e06f9bfe1dfcae56a513dd7420aca52d36ba21a2b122352ec3ee15fd4b821cb817c6d8e39508d7bf4d2873068af8f
data/README.md CHANGED
@@ -128,7 +128,17 @@ changelog({
128
128
  "de-DE" => "Dieses Update ist super"
129
129
  })
130
130
  ```
131
+ If you wish to skip automated submission to review you can provide `--skip-deploy` option when calling `deliver`.
131
132
 
133
+ #### Upload a new ipa for TestFlight beta testers
134
+
135
+ In order to upload beta `.ipa` you need to specify beta_ipa path in your `Deliverfile`
136
+
137
+ ```ruby
138
+ beta_ipa "./latest.ipa"
139
+ ```
140
+
141
+ and provide `--beta` option when calling `deliver`.
132
142
 
133
143
  #### Implement blocks to run unit tests
134
144
  ```ruby
@@ -169,8 +179,8 @@ keywords ["keyword1", "something", "else"]
169
179
  #### Read content from somewhere external (file, web service, ...)
170
180
  ```ruby
171
181
  description({
172
- "en-US" => File.read("changelog-en.txt")
173
- "de-DE" => open("http://example.com/latest-changelog.txt").read
182
+ "en-US" => File.read("description-en.txt")
183
+ "de-DE" => open("http://example.com/app_description.txt").read
174
184
  })
175
185
  ```
176
186
 
@@ -248,7 +258,7 @@ This is especially important if you have more than one iTunes Connect account in
248
258
  DELIVER_PASSWORD
249
259
 
250
260
  ## Implement your custom solution
251
- Take a look at [Using the exposed Ruby classes](use-the-exposed-ruby-classes).
261
+ Take a look at [Using the exposed Ruby classes](#use-the-exposed-ruby-classes).
252
262
 
253
263
  # Can I trust *Deliver*?
254
264
  ###How does this thing even work? Is magic involved? 🎩###
@@ -306,18 +316,9 @@ You should not deploy a new App Store update after every commit, since you still
306
316
  ## Editing the ```Deliverfile```
307
317
  Change syntax highlighting to *Ruby*.
308
318
 
309
- ## In progress
310
- These are features, which are implemented, but not yet fully tested and production ready. You can try it on your own risk.
311
-
312
- #### Distribute an ipa file to your TestFlight beta testers
313
- ```ruby
314
- beta_ipa "./latest.ipa"
315
- ```
316
- This will upload the ipa file to iTunes Connect and mark the uploaded build as Beta build.
317
-
318
319
  # Need help?
319
320
  - If there is a technical problem with ```Deliver```, submit an issue. Run ```deliver --trace``` to get the stacktrace.
320
- - I'm available for contract work - drop me an email: deliver@felixkrause.at
321
+ - I'm available for contract work - drop me an email: deliver@krausefx.com
321
322
 
322
323
  # License
323
324
  This project is licensed under the terms of the MIT license. See the LICENSE file.
@@ -4,12 +4,15 @@ command :run do |c|
4
4
  c.syntax = 'deliver'
5
5
  c.description = 'Run a deploy process using the Deliverfile in the current folder'
6
6
  c.option '--force', 'Runs a deployment without verifying any information (PDF file). This can be used for build servers.'
7
+ c.option '--beta', 'Runs a deployment to beta build on iTunes Connect'
8
+ c.option '--skip-deploy', 'Skips deployment on iTunes Connect'
7
9
  c.action do |args, options|
8
10
  Deliver::DependencyChecker.check_dependencies
9
11
 
10
12
  if File.exists?(deliver_path)
11
13
  # Everything looks alright, use the given Deliverfile
12
- Deliver::Deliverer.new(deliver_path, force: options.force)
14
+ options.default :beta => false, :skip_deploy => false
15
+ Deliver::Deliverer.new(deliver_path, force: options.force, is_beta_ipa: options.beta, skip_deploy: options.skip_deploy)
13
16
  else
14
17
  Deliver::Helper.log.warn("No Deliverfile found at path '#{deliver_path}'.")
15
18
  if agree("Do you want to create a new Deliverfile at the current directory? (y/n)", true)
@@ -17,4 +20,4 @@ command :run do |c|
17
20
  end
18
21
  end
19
22
  end
20
- end
23
+ end
@@ -15,7 +15,10 @@ module Deliver
15
15
  # @return (Deliver::App) The App that is currently being edited.
16
16
  attr_accessor :app
17
17
 
18
- # @return (Hash) All the updated/new information we got from the Deliverfile.
18
+ # @return (Deliver::IpaUploader) The IPA uploader that is currently being used.
19
+ attr_accessor :ipa
20
+
21
+ # @return (Hash) All the updated/new information we got from the Deliverfile.
19
22
  # is used to store the deploy information until the Deliverfile finished running.
20
23
  attr_accessor :deploy_information
21
24
 
@@ -28,7 +31,7 @@ module Deliver
28
31
  begin
29
32
  run_unit_tests
30
33
  fetch_information_from_ipa_file
31
-
34
+
32
35
  Helper.log.info("Got all information needed to deploy a new update ('#{@app_version}') for app '#{@app_identifier}'")
33
36
 
34
37
  verify_ipa_file
@@ -38,7 +41,7 @@ module Deliver
38
41
  load_metadata_from_config_json_folder # the json file generated from the quick start
39
42
  set_app_metadata
40
43
  set_screenshots
41
-
44
+
42
45
  verify_pdf_file
43
46
 
44
47
  trigger_metadata_upload
@@ -68,11 +71,23 @@ module Deliver
68
71
  def fetch_information_from_ipa_file
69
72
  @app_version = @deploy_information[Deliverer::ValKey::APP_VERSION]
70
73
  @app_identifier = @deploy_information[Deliverer::ValKey::APP_IDENTIFIER]
71
-
72
- used_ipa_file = @deploy_information[:ipa] || @deploy_information[:beta_ipa]
74
+
75
+ if is_release_build?
76
+ used_ipa_file = @deploy_information[:ipa]
77
+ elsif is_beta_build?
78
+ used_ipa_file = @deploy_information[:beta_ipa]
79
+ end
73
80
 
74
81
  if used_ipa_file
75
- @ipa = Deliver::IpaUploader.new(Deliver::App.new, '/tmp/', used_ipa_file, is_beta_build?)
82
+ upload_strategy = Deliver::IPA_UPLOAD_STRATEGY_APP_STORE
83
+ if is_beta_build?
84
+ upload_strategy = Deliver::IPA_UPLOAD_STRATEGY_BETA_BUILD
85
+ end
86
+ if skip_deployment?
87
+ upload_strategy = Deliver::IPA_UPLOAD_STRATEGY_JUST_UPLOAD
88
+ end
89
+
90
+ @ipa = Deliver::IpaUploader.new(Deliver::App.new, '/tmp/', used_ipa_file, upload_strategy)
76
91
 
77
92
  # We are able to fetch some metadata directly from the ipa file
78
93
  # If they were also given in the Deliverfile, we will compare the values
@@ -84,9 +99,6 @@ module Deliver
84
99
  def verify_ipa_file
85
100
  raise Deliverfile::Deliverfile::DeliverfileDSLError.new(Deliverfile::Deliverfile::MISSING_APP_IDENTIFIER_MESSAGE.red) unless @app_identifier
86
101
  raise Deliverfile::Deliverfile::DeliverfileDSLError.new(Deliverfile::Deliverfile::MISSING_VERSION_NUMBER_MESSAGE.red) unless @app_version
87
- if (@deploy_information[Deliverer::ValKey::IPA] and @deploy_information[Deliverer::ValKey::BETA_IPA])
88
- raise Deliverfile::Deliverfile::DeliverfileDSLError.new("You can not set both ipa and beta_ipa in one file. Either it's a beta build or a release build".red)
89
- end
90
102
  end
91
103
 
92
104
  def create_app
@@ -95,7 +107,7 @@ module Deliver
95
107
  end
96
108
 
97
109
  def verify_app_on_itunesconnect
98
- if @ipa and not is_beta_build?
110
+ if @ipa and is_release_build?
99
111
  # This is a real release, which should also upload the ipa file onto production
100
112
  @app.create_new_version!(@app_version) unless Helper.is_test?
101
113
  @app.metadata.verify_version(@app_version)
@@ -148,7 +160,7 @@ module Deliver
148
160
 
149
161
  def set_screenshots
150
162
  screens_path = @deploy_information[Deliverer::ValKey::SCREENSHOTS_PATH]
151
-
163
+
152
164
  # Check if there is a Snapfile
153
165
  if File.exists?('./Snapfile') and not screens_path
154
166
 
@@ -258,8 +270,16 @@ module Deliver
258
270
  return app_version
259
271
  end
260
272
 
273
+ def skip_deployment?
274
+ @deploy_information[Deliverer::ValKey::SKIP_DEPLOY]
275
+ end
276
+
277
+ def is_release_build?
278
+ is_beta_build? == false
279
+ end
280
+
261
281
  def is_beta_build?
262
- @deploy_information[Deliverer::ValKey::BETA_IPA] != nil
282
+ @deploy_information[Deliverer::ValKey::IS_BETA_IPA]
263
283
  end
264
284
  end
265
- end
285
+ end
@@ -1,7 +1,7 @@
1
1
  module Deliver
2
2
  # This class will collect the deploy data from different places
3
3
  # This will trigger:
4
- #
4
+ #
5
5
  # - Parsing the Deliverfile
6
6
  # - Temporary storing all the information got from the file, until the file finished executing
7
7
  # - Triggering the upload process itself using the DeliverProcess class
@@ -18,9 +18,11 @@ module Deliver
18
18
  APPLE_ID = :apple_id
19
19
  APP_VERSION = :version
20
20
  IPA = :ipa
21
- BETA_IPA = :beta_ipa
22
21
  DESCRIPTION = :description
23
22
  TITLE = :title
23
+ BETA_IPA = :beta_ipa
24
+ IS_BETA_IPA = :is_beta_ipa
25
+ SKIP_DEPLOY = :skip_deploy
24
26
  CHANGELOG = :changelog
25
27
  SUPPORT_URL = :support_url
26
28
  PRIVACY_URL = :privacy_url
@@ -39,16 +41,18 @@ module Deliver
39
41
  ERROR = :error
40
42
  end
41
43
 
42
-
44
+
43
45
  # Start a new deployment process based on the given Deliverfile
44
46
  # @param (String) path The path to the Deliverfile.
45
47
  # @param (Hash) hash You can pass a hash instead of a path to basically
46
48
  # give all the information required (see {Deliverer::ValKey} for available options)
47
- # @param (Bool) force Runs a deployment without verifying any information. This can be
49
+ # @param (Bool) force Runs a deployment without verifying any information. This can be
48
50
  # used for build servers. If this is set to false a PDF summary will be generated and opened
49
- def initialize(path = nil, hash: nil, force: false)
51
+ def initialize(path = nil, hash: nil, force: false, is_beta_ipa: false, skip_deploy: false)
50
52
  @deliver_process = DeliverProcess.new
51
53
  @deliver_process.deploy_information[ValKey::SKIP_PDF] = true if force
54
+ @deliver_process.deploy_information[ValKey::IS_BETA_IPA] = is_beta_ipa
55
+ @deliver_process.deploy_information[ValKey::SKIP_DEPLOY] = skip_deploy
52
56
 
53
57
  if hash
54
58
  hash.each do |key, value|
@@ -65,14 +69,14 @@ module Deliver
65
69
  end
66
70
 
67
71
  # This method is internally called from the Deliverfile DSL
68
- # to set a value for a given key. This method will also verify if
72
+ # to set a value for a given key. This method will also verify if
69
73
  # the key is valid.
70
74
  def set_new_value(key, value)
71
75
  unless self.class.all_available_keys_to_set.include?key
72
76
  raise "Invalid key '#{key}', must be contained in Deliverer::ValKey.".red
73
77
  end
74
78
 
75
- if @deliver_process.deploy_information[key]
79
+ if @deliver_process.deploy_information[key]
76
80
  Helper.log.warn("You already set a value for key '#{key}'. Overwriting value '#{value}' with new value.")
77
81
  end
78
82
 
@@ -85,7 +89,7 @@ module Deliver
85
89
  end
86
90
 
87
91
  # An array of all available options to be set a deployment_information.
88
- #
92
+ #
89
93
  # Is used to verify user inputs
90
94
  # @return (Hash) The array of symbols
91
95
  def self.all_available_keys_to_set
@@ -93,20 +97,20 @@ module Deliver
93
97
  end
94
98
 
95
99
  # An array of all available blocks to be set for a deployment
96
- #
100
+ #
97
101
  # Is used to verify user inputs
98
102
  # @return (Hash) The array of symbols
99
103
  def self.all_available_blocks_to_set
100
104
  Deliverer::AllBlocks.constants.collect { |a| Deliverer::AllBlocks.const_get(a) }
101
105
  end
102
106
 
103
- # This method will take care of the actual deployment process, after we
104
- # received all information from the Deliverfile.
105
- #
107
+ # This method will take care of the actual deployment process, after we
108
+ # received all information from the Deliverfile.
109
+ #
106
110
  # This method will be called from the {Deliver::Deliverfile} after
107
111
  # it is finished executing the Ruby script.
108
112
  def finished_executing_deliver_file
109
113
  deliver_process.run
110
114
  end
111
115
  end
112
- end
116
+ end
@@ -32,4 +32,4 @@ module Deliver
32
32
  end
33
33
  end
34
34
  end
35
- end
35
+ end
@@ -13,11 +13,11 @@ module Deliver
13
13
 
14
14
  class DeliverfileDSLError < StandardError
15
15
  end
16
-
16
+
17
17
  # Setting all the metadata
18
18
  def method_missing(method_sym, *arguments, &block)
19
19
  allowed = Deliver::Deliverer.all_available_keys_to_set
20
- not_translated = [:ipa, :beta_ipa, :app_identifier, :apple_id, :screenshots_path, :config_json_folder, :submit_further_information]
20
+ not_translated = [:ipa, :app_identifier, :apple_id, :screenshots_path, :config_json_folder, :submit_further_information]
21
21
 
22
22
  if allowed.include?(method_sym)
23
23
  value = arguments.first || block.call
@@ -25,7 +25,7 @@ module Deliver
25
25
  unless value
26
26
  Helper.log.error(caller)
27
27
  Helper.log.fatal("No value or block passed to method '#{method_sym}'")
28
- raise DeliverfileDSLError.new(MISSING_VALUE_ERROR_MESSAGE.red)
28
+ raise DeliverfileDSLError.new(MISSING_VALUE_ERROR_MESSAGE.red)
29
29
  end
30
30
 
31
31
  if (not value.kind_of?Hash) and (not not_translated.include?method_sym)
@@ -57,10 +57,10 @@ module Deliver
57
57
  # This method can be used to set a default language, which is used
58
58
  # when passing a string to metadata changes, instead of a hash
59
59
  # containing multiple languages.
60
- #
60
+ #
61
61
  # This is approach only is recommend for deployments where you are only
62
62
  # supporting one language.
63
- #
63
+ #
64
64
  # The language itself must be included in {Deliver::Languages::ALL_LANGUAGES}.
65
65
  # @example
66
66
  # default_language 'en-US'
@@ -69,7 +69,7 @@ module Deliver
69
69
  def default_language(value = nil)
70
70
  # Verify, default_language is on the top of the file
71
71
  already_set = @deliver_data.deliver_process.deploy_information
72
- minimum = (already_set[:skip_pdf] ? 2 : 1) # skip_pdf + blocks
72
+ minimum = (already_set[:skip_pdf] ? 4 : 3) # skip_pdf + blocks
73
73
  if already_set.count > minimum
74
74
  raise "'default_language' must be on the top of the Deliverfile.".red
75
75
  end
@@ -113,17 +113,17 @@ module Deliver
113
113
  end
114
114
 
115
115
  # Set the apps new version number.
116
- #
117
- # If you do not set this, it will automatically being fetched from the
116
+ #
117
+ # If you do not set this, it will automatically being fetched from the
118
118
  # IPA file.
119
119
  def version(value = nil)
120
120
  value ||= yield if block_given?
121
121
  raise DeliverfileDSLError.new(MISSING_VALUE_ERROR_MESSAGE.red) unless value
122
122
  raise DeliverfileDSLError.new("The app version should be a string".red) unless value.kind_of?(String)
123
-
123
+
124
124
  @deliver_data.set_new_value(Deliverer::ValKey::APP_VERSION, value)
125
125
  end
126
-
126
+
127
127
  private
128
128
  def validate_ipa(value)
129
129
  raise DeliverfileDSLError.new(INVALID_IPA_FILE_GIVEN.red) unless value
@@ -132,4 +132,4 @@ module Deliver
132
132
  end
133
133
  end
134
134
  end
135
- end
135
+ end
@@ -2,22 +2,28 @@ require 'zip'
2
2
  require 'plist'
3
3
 
4
4
  module Deliver
5
- class IpaUploaderError < StandardError
5
+ class IpaUploaderError < StandardError
6
6
  end
7
7
 
8
+ IPA_UPLOAD_STRATEGY_APP_STORE = 1
9
+ IPA_UPLOAD_STRATEGY_BETA_BUILD = 2
10
+ IPA_UPLOAD_STRATEGY_JUST_UPLOAD = 3
11
+
8
12
  # This class takes care of preparing and uploading the given ipa file
9
13
  # Metadata + IPA file can not be handled in one file
10
14
  class IpaUploader < AppMetadata
11
15
  attr_accessor :app
16
+ attr_accessor :publish_strategy
12
17
 
13
18
  # Create a new uploader for one ipa file. This will only upload the ipa and no
14
19
  # other app metadata.
15
20
  # @param app (Deliver::App) The app for which the ipa should be uploaded for
16
21
  # @param dir (String) The path to where we can store (copy) the ipa file. Usually /tmp/
17
22
  # @param ipa_path (String) The path to the IPA file which should be uploaded
18
- # @param is_beta_build (Bool) If it's a beta build, it will be released to the testers, otherwise into production
23
+ # @param publish_strategy (Int) If it's a beta build, it will be released to the testers.
24
+ # If it's a production build it will be released into production. Otherwise no action.
19
25
  # @raise (IpaUploaderError) Is thrown when the ipa file was not found or is not valid
20
- def initialize(app, dir, ipa_path, is_beta_build)
26
+ def initialize(app, dir, ipa_path, publish_strategy)
21
27
  ipa_path.strip! # remove unused white spaces
22
28
  raise IpaUploaderError.new("IPA on path '#{ipa_path}' not found") unless File.exists?(ipa_path)
23
29
  raise IpaUploaderError.new("IPA on path '#{ipa_path}' is not a valid IPA file") unless ipa_path.include?".ipa"
@@ -25,7 +31,7 @@ module Deliver
25
31
  super(app, dir, false)
26
32
 
27
33
  @ipa_file = Deliver::MetadataItem.new(ipa_path)
28
- @is_beta_build = is_beta_build
34
+ @publish_strategy = publish_strategy
29
35
  end
30
36
 
31
37
  # Fetches the app identifier (e.g. com.facebook.Facebook) from the given ipa file.
@@ -80,14 +86,14 @@ module Deliver
80
86
  return is_okay
81
87
  end
82
88
 
83
-
89
+
84
90
 
85
91
  private
86
92
  # This method will trigger the iTunesConnect class to choose the latest build
87
93
  def publish_on_itunes_connect(submit_information = nil)
88
- if not @is_beta_build
94
+ if @publish_strategy == IPA_UPLOAD_STRATEGY_APP_STORE
89
95
  return publish_production_build(submit_information)
90
- else
96
+ elsif @publish_strategy == IPA_UPLOAD_STRATEGY_BETA_BUILD
91
97
  return publish_beta_build
92
98
  end
93
99
  return false
@@ -159,4 +165,4 @@ module Deliver
159
165
  end
160
166
 
161
167
  end
162
- end
168
+ end
@@ -417,12 +417,14 @@ module Deliver
417
417
  # Export Compliance #
418
418
  #####################
419
419
  if page.has_content?"Export"
420
+
420
421
  if not perms[:export_compliance][:encryption_updated] and perms[:export_compliance][:cryptography_enabled]
421
422
  raise "encryption_updated must be enabled if cryptography_enabled is enabled!"
422
423
  end
423
424
 
424
425
  begin
425
- first(:xpath, "#{basic}.exportCompliance.encryptionUpdated.value' and @radio-value='#{perms[:export_compliance][:encryption_updated]}']//input").trigger('click')
426
+ encryption_updated_control = all(:xpath, "#{basic}.exportCompliance.encryptionUpdated.value' and @radio-value='#{perms[:export_compliance][:encryption_updated]}']//input")
427
+ encryption_updated_control[0].trigger('click') if encryption_updated_control.count > 0
426
428
  first(:xpath, "#{basic}.exportCompliance.usesEncryption.value' and @radio-value='#{perms[:export_compliance][:cryptography_enabled]}']//input").trigger('click')
427
429
  first(:xpath, "#{basic}.exportCompliance.isExempt.value' and @radio-value='#{perms[:export_compliance][:is_exempt]}']//input").trigger('click')
428
430
  rescue
@@ -1,3 +1,3 @@
1
1
  module Deliver
2
- VERSION = "0.3.7"
2
+ VERSION = "0.4.0.beta1"
3
3
  end
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.3.7
4
+ version: 0.4.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-03 00:00:00.000000000 Z
11
+ date: 2014-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -297,7 +297,7 @@ description: "Using Deliver you can easily integrate a real continuous delivery
297
297
  once in a so called\n Deliverfile and store it in git, to easily deploy from
298
298
  every machine, even your Continuos Integration server"
299
299
  email:
300
- - krausefx@gmail.com
300
+ - deliver@krausefx.com
301
301
  executables:
302
302
  - deliver
303
303
  extensions: []
@@ -334,7 +334,7 @@ files:
334
334
  - lib/deliver/pdf_generator.rb
335
335
  - lib/deliver/update_checker.rb
336
336
  - lib/deliver/version.rb
337
- homepage: http://felixkrause.at
337
+ homepage: http://krausefx.com
338
338
  licenses:
339
339
  - MIT
340
340
  metadata: {}
@@ -350,9 +350,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
350
350
  version: 2.0.0
351
351
  required_rubygems_version: !ruby/object:Gem::Requirement
352
352
  requirements:
353
- - - '>='
353
+ - - '>'
354
354
  - !ruby/object:Gem::Version
355
- version: '0'
355
+ version: 1.3.1
356
356
  requirements: []
357
357
  rubyforge_project:
358
358
  rubygems_version: 2.2.2