capistrano-magento2 0.5.6 → 0.5.8

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: 1c6d561b4e1c051ef45a5eac22efa567f332611e
4
- data.tar.gz: 7cdceb46e41430c23912d013db3cc25a91b5397c
3
+ metadata.gz: bd0274d749aa804a3b80628664a330835e02dba2
4
+ data.tar.gz: 8aba5b376eed205074d70844aff9d7076f5c6e9e
5
5
  SHA512:
6
- metadata.gz: d485a334191bc07b1764effc19e4b9b5faef397c978b981adacea69ad629a408b22ce2633022b777bf7d7dcae5f1d5e39d867ad2838871852948777c509f5289
7
- data.tar.gz: dfe2f1b2c179df1b3bc88b2655803ab8fd82070b6bd58e00dc5dcd4c9dcbc054e92f934f68c61fbfa1721c6ddc4dc7f6a01712f805c6bdd0b92bd97f0b739766
6
+ metadata.gz: 76b8f66d1db89cdeab58bc7c1cfe143abc99587a1cf3dfcbd0364aff1177babdcffaf550444758d84a382c62ee6e16ca221e4307be91b611fe76e89d20b31195
7
+ data.tar.gz: 8ebe366a649d741d54ff83f52f65803ce9b0bf7ad037774b47e757b965ac6ba0ad72793cb8b9eb730bfbc95cd0f820fe9ab7efc96a576ea8f6a4ac46671bbc76
data/CHANGELOG.md CHANGED
@@ -1,9 +1,20 @@
1
1
  # Capistrano::Magento2 Change Log
2
2
 
3
+ 0.5.8
4
+ ==========
5
+
6
+ * Fixed critical failure due to command map being broken in v0.5.7 updates
7
+
8
+ 0.5.7
9
+ ==========
10
+
11
+ * Fixed failing deploys for Magento 2.1.0 caused by improper version checks on flags added in version 2.1.1 (issue #45)
12
+ * Fixed failure to detect error codes Magento 2.1.1 returns on a failed static-content deploy job (issue #44)
13
+
3
14
  0.5.6
4
15
  ==========
5
16
 
6
- * Fixed issue where setup:di:compile failing to return an exit code caused DI compilation failures to be masked
17
+ * Fixed issue where setup:di:compile failing to return an exit code caused DI compilation failures to be masked (issue #41)
7
18
 
8
19
  0.5.5
9
20
  ==========
data/README.md CHANGED
@@ -114,7 +114,7 @@ Before you can use Capistrano to deploy, you must configure the `config/deploy.r
114
114
  | `:magento_deploy_setup_role` | `:all` | Role from which primary host is chosen to run things like setup:upgrade on
115
115
  | `:magento_deploy_cache_shared` | `true` | If true, cache operations are restricted to the primary node in setup role
116
116
  | `:magento_deploy_languages` | `['en_US']` | Array of languages passed to static content deploy routine
117
- | `:magento_deploy_themes` | `[]` | Array of themes passed to static content deploy routine (Magento 2.1+ only)
117
+ | `:magento_deploy_themes` | `[]` | Array of themes passed to static content deploy (Magento 2.1.1 and later)
118
118
  | `:magento_deploy_composer` | `true` | Enables composer install behaviour in the built-in deploy routine
119
119
  | `:magento_deploy_production` | `true` | Enables production specific DI compilation and static content generation
120
120
  | `:magento_deploy_maintenance` | `true` | Enables use of maintenance mode while magento:setup:upgrade runs
@@ -13,7 +13,7 @@ module Capistrano
13
13
  module Magento2
14
14
  module Helpers
15
15
  def magento_version
16
- return (capture "/usr/bin/env php -f #{release_path}/bin/magento -- -V").split(' ').pop.to_f
16
+ return Gem::Version::new((capture "/usr/bin/env php -f #{release_path}/bin/magento -- -V").split(' ').pop)
17
17
  end
18
18
 
19
19
  def disabled_modules
@@ -33,10 +33,20 @@ module Capistrano
33
33
 
34
34
  module Setup
35
35
  def static_content_deploy params
36
+ # Setting pipefail causes the console exit codes introduced in Magento 2.1.1 to bubble up and halt execution
37
+ # as is normally expected. Versions which do not return exit codes will fall back on the far less reliable
38
+ # error checks we're doing on the command output
39
+ magento_command = SSHKit.config.command_map[:magento]
40
+ SSHKit.config.command_map[:magento] = "set -o pipefail; #{magento_command}"
41
+
36
42
  output = capture :magento,
37
43
  "setup:static-content:deploy #{params} | stdbuf -o0 tr -d .",
38
44
  verbosity: Logger::INFO
39
45
 
46
+ # Reset the command map without our prefix, removing pipefail option so it won't affect other commands
47
+ SSHKit.config.command_map[:magento] = magento_command
48
+
49
+ # String based error checking is here to catch errors in Magento 2.1.0 and earlier
40
50
  if not output.to_s.include? 'New version of deployed files'
41
51
  raise Exception, "\e[0;31mFailed to compile static assets\e[0m"
42
52
  end
@@ -9,6 +9,6 @@
9
9
 
10
10
  module Capistrano
11
11
  module Magento2
12
- VERSION = '0.5.6'
12
+ VERSION = '0.5.8'
13
13
  end
14
14
  end
@@ -11,7 +11,7 @@ include Capistrano::Magento2::Helpers
11
11
  include Capistrano::Magento2::Setup
12
12
 
13
13
  namespace :magento do
14
-
14
+
15
15
  namespace :cache do
16
16
  desc 'Flush Magento cache storage'
17
17
  task :flush do
@@ -93,7 +93,7 @@ namespace :magento do
93
93
 
94
94
  execute :composer, "install #{composer_flags} 2>&1"
95
95
 
96
- if fetch(:magento_deploy_production) and magento_version > 2.0
96
+ if fetch(:magento_deploy_production) and magento_version >= Gem::Version.new('2.1')
97
97
  composer_flags += ' --no-dev'
98
98
  execute :composer, "install #{composer_flags} 2>&1" # removes require-dev components from prev command
99
99
  end
@@ -246,10 +246,10 @@ namespace :magento do
246
246
  deploy_languages = fetch(:magento_deploy_languages).join(' ')
247
247
  deploy_themes = fetch(:magento_deploy_themes)
248
248
 
249
- if deploy_themes.count() > 0 and _magento_version >= 2.1
249
+ if deploy_themes.count() > 0 and _magento_version >= Gem::Version.new('2.1.1')
250
250
  deploy_themes = deploy_themes.join(' -t ').prepend(' -t ')
251
251
  elsif deploy_themes.count() > 0
252
- warn "\e[0;31mWarning: Magento 2.0 does not support :magento_deploy_themes setting (ignoring value)\e[0m"
252
+ warn "\e[0;31mWarning: the :magento_deploy_themes setting is only supported in Magento 2.1.1 and later\e[0m"
253
253
  deploy_themes = nil
254
254
  else
255
255
  deploy_themes = nil
@@ -270,8 +270,8 @@ namespace :magento do
270
270
  deploy_flags = ['javascript', 'css', 'less', 'images', 'fonts', 'html', 'misc', 'html-minify']
271
271
  .join(' --no-').prepend(' --no-');
272
272
 
273
- # Magento 2.0 does not have these flags, so only way to generate secure files is to do all of them :/
274
- deploy_flags = nil if _magento_version <= 2.0
273
+ # Magento 2.1.0 and earlier lack support for these flags, so generation of secure files requires full re-run
274
+ deploy_flags = nil if _magento_version <= Gem::Version.new('2.1.0')
275
275
 
276
276
  within release_path do with(https: 'on') {
277
277
  static_content_deploy "#{deploy_languages}#{deploy_themes}#{deploy_flags}"
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.5.6
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Alger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-11 00:00:00.000000000 Z
11
+ date: 2016-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano