capistrano-magento2 0.6.1 → 0.6.2

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: 65c2dad3cf15d919401c8553410a7b8cf444e9e3
4
- data.tar.gz: a197832d493ef6ba2d6725b63e8f3ae2e2c7586e
3
+ metadata.gz: c99400c3af7e1ed48ca398c4f6c4c79fb4298f93
4
+ data.tar.gz: 8e735613090124de7fd60e88f0d95d17909c0258
5
5
  SHA512:
6
- metadata.gz: 17d6863ccc339acc538abedfd0fc71e12a3414064f47dd09a63b028dfebffdf676b9babc60a312e18e7251c608b5fa2f40a0d6c2092a98a296ae1c3cb58b44c6
7
- data.tar.gz: d9f4abb0ee29c32e9628efb2f03437e4e56b299d82e8622e86378d3e4c5ee7033a7344929f348dc2d974cad698352c376b3a866378919bae15e9a7a25aff7355
6
+ metadata.gz: 5ddb0e0e04bbe4e8e3d3a15931855ab3afa266267bedcc4ef02d89a71e1f0646544d4696d248cd41a3b1a900591f903d150025d745f3746c8e32188fdc087e04
7
+ data.tar.gz: 8382519a6b95039033d50b5af5c617ff407b84472fcaf0c25d34780b95df248b21f0c1365fcb9b3c909a13f7207fa770dc8c8bc77861f0af86f2322e2333b86d
@@ -1,5 +1,13 @@
1
1
  # Capistrano::Magento2 Change Log
2
2
 
3
+ 0.6.2
4
+ ==========
5
+
6
+ * Added setting `:magento_deploy_jobs` to support configuring number of parallel static content deployment tasks
7
+ * Fixed issue where ./update dir may exist without a composer.json file, causing deployment failure
8
+ * Updated uses of bin/magento where output is parsed to include `--no-ansi` to eliminate potential failures
9
+ * Improved error reporting on static content deployment failure
10
+
3
11
  0.6.1
4
12
  ==========
5
13
 
data/README.md CHANGED
@@ -120,6 +120,7 @@ Before you can use Capistrano to deploy, you must configure the `config/deploy.r
120
120
  | `:magento_deploy_cache_shared` | `true` | If true, cache operations are restricted to the primary node in setup role
121
121
  | `:magento_deploy_languages` | `['en_US']` | Array of languages passed to static content deploy routine
122
122
  | `:magento_deploy_themes` | `[]` | Array of themes passed to static content deploy (Magento 2.1.1 and later)
123
+ | `:magento_deploy_jobs` | `4` | Number of threads to use for static content deploy (Magento 2.1.1 and later)
123
124
  | `:magento_deploy_composer` | `true` | Enables composer install behaviour in the built-in deploy routine
124
125
  | `:magento_deploy_production` | `true` | Enables production specific DI compilation and static content generation
125
126
  | `:magento_deploy_maintenance` | `true` | Enables use of maintenance mode while magento:setup:upgrade runs
@@ -17,7 +17,7 @@ module Capistrano
17
17
  end
18
18
 
19
19
  def disabled_modules
20
- output = capture :magento, 'module:status'
20
+ output = capture :magento, 'module:status --no-ansi'
21
21
  output = output.split("disabled modules:\n", 2)[1]
22
22
 
23
23
  if output == nil or output.strip == "None"
@@ -48,19 +48,19 @@ module Capistrano
48
48
  def static_content_deploy params
49
49
  Helpers.set_pipefail
50
50
  output = capture :magento,
51
- "setup:static-content:deploy #{params} | stdbuf -o0 tr -d .",
51
+ "setup:static-content:deploy --no-ansi #{params} | stdbuf -o0 tr -d .",
52
52
  verbosity: Logger::INFO
53
53
  Helpers.unset_pipefail
54
54
 
55
55
  # String based error checking is here to catch errors in Magento 2.1.0 and earlier; later versions will exit
56
56
  # immediately when a console exit code is retruned, never evaluating this code.
57
57
  if not output.to_s.include? 'New version of deployed files'
58
- raise Exception, "\e[0;31mFailed to compile static assets\e[0m"
58
+ raise Exception, "\e[0;31mFailed to compile static assets. No new version found in command output!\e[0m"
59
59
  end
60
60
 
61
61
  output.to_s.each_line { |line|
62
62
  if line.split('errors: ', 2).pop.to_i > 0
63
- raise Exception, "\e[0;31mFailed to compile static assets\e[0m"
63
+ raise Exception, "\e[0;31mFailed to compile static assets. Errors found in command output: #{line}\e[0m"
64
64
  end
65
65
  }
66
66
  end
@@ -48,6 +48,7 @@ set :magento_deploy_languages, fetch(:magento_deploy_languages, ['en_US'])
48
48
  set :magento_deploy_maintenance, fetch(:magento_deploy_maintenance, true)
49
49
  set :magento_deploy_production, fetch(:magento_deploy_production, true)
50
50
  set :magento_deploy_themes, fetch(:magento_deploy_themes, [])
51
+ set :magento_deploy_jobs, fetch(:magento_deploy_jobs, nil) # this defaults to 4 when supported by bin/magento
51
52
 
52
53
  # deploy targetting defaults
53
54
  set :magento_deploy_setup_role, fetch(:magento_deploy_setup_role, :all)
@@ -9,6 +9,6 @@
9
9
 
10
10
  module Capistrano
11
11
  module Magento2
12
- VERSION = '0.6.1'
12
+ VERSION = '0.6.2'
13
13
  end
14
14
  end
@@ -98,10 +98,10 @@ namespace :magento do
98
98
  execute :composer, "install #{composer_flags} 2>&1" # removes require-dev components from prev command
99
99
  end
100
100
 
101
- if test "[ -d #{release_path}/update ]" # can't count on this, but emit warning if not present
101
+ if test "[ -f #{release_path}/update/composer.json ]" # can't count on this, but emit warning if not present
102
102
  execute :composer, "install #{composer_flags} -d ./update 2>&1"
103
103
  else
104
- puts "\e[0;31m Warning: ./update dir does not exist in repository!\n\e[0m\n"
104
+ puts "\e[0;31m Warning: ./update/composer.json does not exist in repository!\n\e[0m\n"
105
105
  end
106
106
  end
107
107
  end
@@ -183,7 +183,7 @@ namespace :magento do
183
183
  task :upgrade do
184
184
  on primary fetch(:magento_deploy_setup_role) do
185
185
  within release_path do
186
- db_status = capture :magento, 'setup:db:status', verbosity: Logger::INFO
186
+ db_status = capture :magento, 'setup:db:status --no-ansi', verbosity: Logger::INFO
187
187
 
188
188
  if not db_status.to_s.include? 'All modules are up to date'
189
189
  execute :magento, 'setup:db-schema:upgrade'
@@ -236,9 +236,9 @@ namespace :magento do
236
236
  # we have to use multi-tenant currently. However, the multi-tenant is being dropped in 2.1 and is no longer
237
237
  # present in the develop mainline, so we are testing for multi-tenant presence for long-term portability.
238
238
  if test :magento, 'setup:di:compile-multi-tenant --help >/dev/null 2>&1'
239
- output = capture :magento, 'setup:di:compile-multi-tenant', verbosity: Logger::INFO
239
+ output = capture :magento, 'setup:di:compile-multi-tenant --no-ansi', verbosity: Logger::INFO
240
240
  else
241
- output = capture :magento, 'setup:di:compile', verbosity: Logger::INFO
241
+ output = capture :magento, 'setup:di:compile --no-ansi', verbosity: Logger::INFO
242
242
  end
243
243
 
244
244
  # 2.0.x never returns a non-zero exit code for errors, so manually check string
@@ -259,6 +259,7 @@ namespace :magento do
259
259
 
260
260
  deploy_languages = fetch(:magento_deploy_languages).join(' ')
261
261
  deploy_themes = fetch(:magento_deploy_themes)
262
+ deploy_jobs = fetch(:magento_deploy_jobs)
262
263
 
263
264
  if deploy_themes.count() > 0 and _magento_version >= Gem::Version.new('2.1.1')
264
265
  deploy_themes = deploy_themes.join(' -t ').prepend(' -t ')
@@ -269,6 +270,15 @@ namespace :magento do
269
270
  deploy_themes = nil
270
271
  end
271
272
 
273
+ if deploy_jobs and _magento_version >= Gem::Version.new('2.1.1')
274
+ deploy_jobs = "--jobs #{deploy_jobs} "
275
+ elsif deploy_jobs
276
+ warn "\e[0;31mWarning: the :magento_deploy_jobs setting is only supported in Magento 2.1.1 and later\e[0m"
277
+ deploy_jobs = nil
278
+ else
279
+ deploy_jobs = nil
280
+ end
281
+
272
282
  # Output is being checked for a success message because this command may easily fail due to customizations
273
283
  # and 2.0.x CLI commands do not return error exit codes on failure. See magento/magento2#3060 for details.
274
284
  within release_path do
@@ -277,7 +287,7 @@ namespace :magento do
277
287
  execute "touch #{release_path}/pub/static/deployed_version.txt"
278
288
 
279
289
  # Generates all but the secure versions of RequireJS configs
280
- static_content_deploy "#{deploy_languages}#{deploy_themes}"
290
+ static_content_deploy "#{deploy_jobs}#{deploy_languages}#{deploy_themes}"
281
291
  end
282
292
 
283
293
  # Run again with HTTPS env var set to 'on' to pre-generate secure versions of RequireJS configs
@@ -288,7 +298,7 @@ namespace :magento do
288
298
  deploy_flags = nil if _magento_version <= Gem::Version.new('2.1.0')
289
299
 
290
300
  within release_path do with(https: 'on') {
291
- static_content_deploy "#{deploy_languages}#{deploy_themes}#{deploy_flags}"
301
+ static_content_deploy "#{deploy_jobs}#{deploy_languages}#{deploy_themes}#{deploy_flags}"
292
302
  } end
293
303
  end
294
304
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-magento2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Alger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-31 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano