capistrano-magento2 0.5.4 → 0.5.5

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: e6d79df3e4bedfce6d856fb16a166c15096e5031
4
- data.tar.gz: eff72c1ebbc3d6e89aa416f9d6f6203e6d995578
3
+ metadata.gz: ab43aa471d09b1d480dcc26eecc39e9155887fe7
4
+ data.tar.gz: 3becffe86075bae268551e1f441bd93a1fef7246
5
5
  SHA512:
6
- metadata.gz: a00856111e7936109a2302fc25af44671041221cc0aabfeb9342217a1275154a00028c925ccfce99091133334a458bc34f5de0218b882426b3b189226ab3318c
7
- data.tar.gz: c4423aac9ac9656a8f8ce7e2efeb0923f980a0d11b4fa27a4b7abf33b18040febb1415d8d539f6b0c68a7d710ee52d1afc7ed055beebb8f41a451b52499d04aa
6
+ metadata.gz: ae3e8515b724bb656e48b836076ef393bb90416dee9542f9b9f30339f1231c7b4e84fa79be6cc7ce337aa1931606169981b1348ca6f29c5aff911a2839ce7817
7
+ data.tar.gz: cf875fc79fabb210c25886b500610ca9ded11c0dbe03a637f70061745f5033358bff87ca2c64b5ccd080504c46083c9866bb547cc66474a6d9389fa1a64df6ae
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Capistrano::Magento2 Change Log
2
2
 
3
+ 0.5.5
4
+ ==========
5
+
6
+ * Fixed DI artifact mismatch caused by setup:ugprade overwriting frozen config.php post compilation
7
+ * Removed redundant (and non-functional) commands from deploy:reverted task
8
+ * Added informational output which lists the installed modules which are disabled per `app/etc/config.php`
9
+
3
10
  0.5.4
4
11
  ==========
5
12
 
@@ -16,6 +16,16 @@ module Capistrano
16
16
  return (capture "/usr/bin/env php -f #{release_path}/bin/magento -- -V").split(' ').pop.to_f
17
17
  end
18
18
 
19
+ def disabled_modules
20
+ output = capture :magento, 'module:status'
21
+ output = output.split("disabled modules:\n", 2)[1]
22
+
23
+ if output == nil or output.strip == "None"
24
+ return []
25
+ end
26
+ return output.split("\n")
27
+ end
28
+
19
29
  def cache_hosts
20
30
  return fetch(:magento_deploy_cache_shared) ? (primary fetch :magento_deploy_setup_role) : (release_roles :all)
21
31
  end
@@ -9,6 +9,6 @@
9
9
 
10
10
  module Capistrano
11
11
  module Magento2
12
- VERSION = '0.5.4'
12
+ VERSION = '0.5.5'
13
13
  end
14
14
  end
@@ -7,6 +7,8 @@
7
7
  # http://davidalger.com/contact/
8
8
  ##
9
9
 
10
+ include Capistrano::Magento2::Helpers
11
+
10
12
  namespace :deploy do
11
13
  before 'deploy:check:linked_files', 'magento:deploy:check'
12
14
 
@@ -37,7 +39,20 @@ namespace :deploy do
37
39
  end
38
40
  end
39
41
 
40
- invoke 'magento:setup:upgrade'
42
+ invoke 'magento:setup:db:schema:upgrade'
43
+ invoke 'magento:setup:db:data:upgrade'
44
+
45
+ on primary fetch(:magento_deploy_setup_role) do
46
+ within release_path do
47
+ _disabled_modules = disabled_modules
48
+ if _disabled_modules.count > 0
49
+ info "\nThe following modules are disabled per app/etc/config.php:\n"
50
+ _disabled_modules.each do |module_name|
51
+ info '- ' + module_name
52
+ end
53
+ end
54
+ end
55
+ end
41
56
  end
42
57
 
43
58
  task :published do
@@ -45,10 +60,4 @@ namespace :deploy do
45
60
  invoke 'magento:cache:varnish:ban'
46
61
  invoke 'magento:maintenance:disable' if fetch(:magento_deploy_maintenance)
47
62
  end
48
-
49
- task :reverted do
50
- invoke 'magento:maintenance:disable' if fetch(:magento_deploy_maintenance)
51
- invoke 'magento:cache:flush'
52
- invoke 'magento:cache:varnish:ban'
53
- end
54
63
  end
@@ -144,15 +144,60 @@ namespace :magento do
144
144
  end
145
145
 
146
146
  namespace :setup do
147
- desc 'Run the Magento upgrade process'
147
+ desc 'Updates the module load sequence and upgrades database schemas and data fixtures'
148
148
  task :upgrade do
149
149
  on primary fetch(:magento_deploy_setup_role) do
150
150
  within release_path do
151
+ warn "\e[0;31mWarning: Use of magento:setup:upgrade on production systems is discouraged." +
152
+ " See https://github.com/davidalger/capistrano-magento2/issues/34 for details.\e[0m\n"
153
+
151
154
  execute :magento, 'setup:upgrade --keep-generated'
152
155
  end
153
156
  end
154
157
  end
155
158
 
159
+ namespace :db do
160
+ desc 'Checks if database schema and/or data require upgrading'
161
+ task :status do
162
+ on primary fetch(:magento_deploy_setup_role) do
163
+ within release_path do
164
+ execute :magento, 'setup:db:status'
165
+ end
166
+ end
167
+ end
168
+
169
+ task :upgrade do
170
+ on primary fetch(:magento_deploy_setup_role) do
171
+ within release_path do
172
+ db_status = capture :magento, 'setup:db:status', verbosity: Logger::INFO
173
+
174
+ if not db_status.to_s.include? 'All modules are up to date'
175
+ execute :magento, 'setup:db-schema:upgrade'
176
+ execute :magento, 'setup:db-data:upgrade'
177
+ end
178
+ end
179
+ end
180
+ end
181
+
182
+ desc 'Upgrades data fixtures'
183
+ task 'schema:upgrade' do
184
+ on primary fetch(:magento_deploy_setup_role) do
185
+ within release_path do
186
+ execute :magento, 'setup:db-schema:upgrade'
187
+ end
188
+ end
189
+ end
190
+
191
+ desc 'Upgrades database schema'
192
+ task 'data:upgrade' do
193
+ on primary fetch(:magento_deploy_setup_role) do
194
+ within release_path do
195
+ execute :magento, 'setup:db-data:upgrade'
196
+ end
197
+ end
198
+ end
199
+ end
200
+
156
201
  desc 'Sets proper permissions on application'
157
202
  task :permissions do
158
203
  on release_roles :all do
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.4
4
+ version: 0.5.5
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-10-21 00:00:00.000000000 Z
11
+ date: 2016-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano