capistrano-magento2 0.5.8 → 0.5.9

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: bd0274d749aa804a3b80628664a330835e02dba2
4
- data.tar.gz: 8aba5b376eed205074d70844aff9d7076f5c6e9e
3
+ metadata.gz: 8898c62e930f71d3b30804d3c0d3834bb75f22c0
4
+ data.tar.gz: 71af2dbbe39540c476c38ba6bdb47d8d95ea1666
5
5
  SHA512:
6
- metadata.gz: 76b8f66d1db89cdeab58bc7c1cfe143abc99587a1cf3dfcbd0364aff1177babdcffaf550444758d84a382c62ee6e16ca221e4307be91b611fe76e89d20b31195
7
- data.tar.gz: 8ebe366a649d741d54ff83f52f65803ce9b0bf7ad037774b47e757b965ac6ba0ad72793cb8b9eb730bfbc95cd0f820fe9ab7efc96a576ea8f6a4ac46671bbc76
6
+ metadata.gz: 7c8f3cdc2b99db147d0f0da84f886c65d91ef38c82e26aeb8e47d12366dd3d8efe86e8a8b366ca90257e7b5d45e549e75d0253ab40f48fc1ecd0e41f6385347b
7
+ data.tar.gz: 209ce16d410078b31ddcc68bee40529792654fd77e029f8ace6e982286a79a1cd21736eaa197cdf94aa5d02d215f339e850940700f9906644b4ca316894188c2
data/CHANGELOG.md CHANGED
@@ -1,12 +1,21 @@
1
1
  # Capistrano::Magento2 Change Log
2
2
 
3
+ 0.5.9
4
+ ==========
5
+
6
+ * Updated README with Capistrano 3.7 setup information
7
+ * Updated `linked_dirs` to link `pub/sitemaps` by default in similar fashion to the Magento1 deployment gem
8
+ * Updated README with guidance on adding a path to the list of `linked_dirs` without copying the entire configuration forward
9
+ * Fixed bug causing pipefail option to persist after `Capistrano::Magento2::Setup.static_content_deploy` is called
10
+
3
11
  0.5.8
4
12
  ==========
5
13
 
6
- * Fixed critical failure due to command map being broken in v0.5.7 updates
14
+ * Fixed critical failure due to command map being broken in v0.5.7 updates (issue #50, issue #51)
7
15
 
8
16
  0.5.7
9
17
  ==========
18
+ _Note: This release was yanked from RubyGems due to a critical failure in the deploy routine._
10
19
 
11
20
  * Fixed failing deploys for Magento 2.1.0 caused by improper version checks on flags added in version 2.1.1 (issue #45)
12
21
  * Fixed failure to detect error codes Magento 2.1.1 returns on a failed static-content deploy job (issue #44)
data/README.md CHANGED
@@ -44,6 +44,10 @@ _Note: By default, Capistrano creates "staging" and "production" stages. If you
44
44
  # Load Magento deployment tasks
45
45
  require 'capistrano/magento2/deploy'
46
46
 
47
+ # Load Git plugin
48
+ require "capistrano/scm/git"
49
+ install_plugin Capistrano::SCM::Git
50
+
47
51
  # Load custom tasks from `lib/capistrano/tasks` if you have any defined
48
52
  Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
49
53
  ```
@@ -143,12 +147,12 @@ For the sake of simplicity in new project setups `:linked_dirs` and `:linked_fil
143
147
  set :linked_files, [
144
148
  'app/etc/env.php',
145
149
  'var/.setup_cronjob_status',
146
- 'var/.update_cronjob_status',
147
- 'pub/sitemap.xml'
150
+ 'var/.update_cronjob_status'
148
151
  ]
149
152
 
150
153
  set :linked_dirs, [
151
- 'pub/media',
154
+ 'pub/media',
155
+ 'pub/sitemaps',
152
156
  'var/backups',
153
157
  'var/composer_home',
154
158
  'var/importexport',
@@ -159,7 +163,11 @@ set :linked_dirs, [
159
163
  ]
160
164
  ```
161
165
 
162
- If you would like to customize the linked files or directories for your project, you can copy either one or both of the above arrays into the `config/deploy.rb` or `config/deploy/*.rb` files and tweak them to fit your project's needs.
166
+ If you would like to customize the linked files or directories for your project, you can copy either one or both of the above arrays into the `config/deploy.rb` or `config/deploy/*.rb` files and tweak them to fit your project's needs. Alternatively, you can add a single linked dir (or file) using `append` like this:
167
+
168
+ ```ruby
169
+ append :linked_dirs, 'path/to/link'
170
+ ```
163
171
 
164
172
  ### Magento 2 Deploy Routine
165
173
 
@@ -29,24 +29,31 @@ module Capistrano
29
29
  def cache_hosts
30
30
  return fetch(:magento_deploy_cache_shared) ? (primary fetch :magento_deploy_setup_role) : (release_roles :all)
31
31
  end
32
+
33
+ # Set pipefail allowing console exit codes in Magento 2.1.1 and later to halt execution when using pipes
34
+ def Helpers.set_pipefail
35
+ if not SSHKit.config.command_map[:magento].include? 'set -o pipefail' # avoids trouble on multi-host deploys
36
+ @@pipefail_less = SSHKit.config.command_map[:magento].dup
37
+ SSHKit.config.command_map[:magento] = "set -o pipefail; #{@@pipefail_less}"
38
+ end
39
+ end
40
+
41
+ # Reset the command map without prefix, removing pipefail option so it won't affect other commands
42
+ def Helpers.unset_pipefail
43
+ SSHKit.config.command_map[:magento] = @@pipefail_less
44
+ end
32
45
  end
33
-
46
+
34
47
  module Setup
35
48
  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
-
49
+ Helpers.set_pipefail
42
50
  output = capture :magento,
43
51
  "setup:static-content:deploy #{params} | stdbuf -o0 tr -d .",
44
52
  verbosity: Logger::INFO
53
+ Helpers.unset_pipefail
45
54
 
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
55
+ # String based error checking is here to catch errors in Magento 2.1.0 and earlier; later versions will exit
56
+ # immediately when a console exit code is retruned, never evaluating this code.
50
57
  if not output.to_s.include? 'New version of deployed files'
51
58
  raise Exception, "\e[0;31mFailed to compile static assets\e[0m"
52
59
  end
@@ -10,19 +10,18 @@
10
10
  set :linked_files, fetch(:linked_files, []).push(
11
11
  'app/etc/env.php',
12
12
  'var/.setup_cronjob_status',
13
- 'var/.update_cronjob_status',
14
- 'pub/sitemap.xml'
13
+ 'var/.update_cronjob_status'
15
14
  )
16
15
 
17
16
  set :linked_files_touch, fetch(:linked_files_touch, []).push(
18
17
  'app/etc/env.php',
19
18
  'var/.setup_cronjob_status',
20
- 'var/.update_cronjob_status',
21
- 'pub/sitemap.xml'
19
+ 'var/.update_cronjob_status'
22
20
  )
23
21
 
24
22
  set :linked_dirs, fetch(:linked_dirs, []).push(
25
- 'pub/media',
23
+ 'pub/media',
24
+ 'pub/sitemaps',
26
25
  'var/backups',
27
26
  'var/composer_home',
28
27
  'var/importexport',
@@ -9,6 +9,6 @@
9
9
 
10
10
  module Capistrano
11
11
  module Magento2
12
- VERSION = '0.5.8'
12
+ VERSION = '0.5.9'
13
13
  end
14
14
  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.5.8
4
+ version: 0.5.9
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-28 00:00:00.000000000 Z
11
+ date: 2017-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano