capistrano-magento2 0.8.9 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/README.md +17 -22
- data/capistrano-magento2.gemspec +3 -3
- data/lib/capistrano/magento2.rb +0 -22
- data/lib/capistrano/magento2/defaults.rb +3 -5
- data/lib/capistrano/magento2/version.rb +1 -1
- data/lib/capistrano/tasks/deploy.rake +2 -13
- data/lib/capistrano/tasks/magento.rake +50 -103
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2cba8da5f0cb88f04b3a8652c05c68ad038b316cb2d216ad0f337678d6cd960
|
4
|
+
data.tar.gz: e23033f29e538b04108a6503f03b859f7e384662ac63543e16fb5e6f01504d5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b8d3b2ef09493a3d2fd84eaec5a71d2abafbc0a71aa59cd57c03c3fda266662e07a7c5b0db0d8be516988b99a4ec2604f7f44b6f0e008656377ab4081d39d55
|
7
|
+
data.tar.gz: c442fdac1b8a659111c6afd33b6f10e373ee11f736ecee4f52db0019cf1b10fa968bc917797bac8afa7d6713ae522e9a64419a5d37dbd75ab5ab8078beb56fd3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,36 @@
|
|
1
1
|
# Capistrano::Magento2 Change Log
|
2
2
|
|
3
|
+
0.9.0
|
4
|
+
=========
|
5
|
+
|
6
|
+
**Upgrade Notes:**
|
7
|
+
|
8
|
+
As of this release only Magento 2.3 and later are supported and **support has been dropped for prior versions** which have long since reached their end-of-life. Moving forward versions past their EOL will no longer be supported by subsequent releases of this gem. Older versions of this gem may continue to be used to deploy older and EOL versions.
|
9
|
+
|
10
|
+
If using a `Gemfile` with Bundler to lock versions of dependencies used for execution, the version lock on `capistrano` should be updated to `~>1.13` to match the minimal requirement of this release, otherwise `bundle update` will fail to update to version `0.9.0` of this gem. The following is recommended:
|
11
|
+
|
12
|
+
```
|
13
|
+
gem 'capistrano', '~> 3.14'
|
14
|
+
gem 'capistrano-magento2', '~> 0.9'
|
15
|
+
```
|
16
|
+
|
17
|
+
If a capistrano version lock is present in a projects `deploy.rb` it will also need to be updated:
|
18
|
+
|
19
|
+
```
|
20
|
+
lock '~> 3.14'
|
21
|
+
```
|
22
|
+
|
23
|
+
**Change Summary:**
|
24
|
+
|
25
|
+
* Dropped support for EOL versions of Magento and scrubbed all gated logic around legacy behaviors in 2.1.x and 2.2.x
|
26
|
+
* Removed `magento:deploy:version_check` task and associated warning when attempting to deploy unsupported versions of Magento
|
27
|
+
* Updated required version of `capistrano` to `~> 1.13` (>=1.13 and less than 2.0)
|
28
|
+
* Resolved inability to use `--dry-run` flag ([issue #128](https://github.com/davidalger/capistrano-magento2/issues/128)) as made possible by the removal of all version related gating logic.
|
29
|
+
* Dropped explicit default of `:magento_deploy_languages`; will now only be passed to `bin/magento` call when set in project configuration.
|
30
|
+
* Updated zero-down deployment logic to rely on `app:config:status` to detect config changes rather than the md5sum of config.php in current and release directories.
|
31
|
+
* Added `magento:app:config:status` to available commands for manual execution.
|
32
|
+
* Fixes issue in 2.3.4 and later where app:config:import may fail if cache:flush is not run immediately prior ([issue #138](https://github.com/davidalger/capistrano-magento2/issues/138))
|
33
|
+
|
3
34
|
0.8.9
|
4
35
|
=========
|
5
36
|
|
data/README.md
CHANGED
@@ -118,35 +118,33 @@ Before you can use Capistrano to deploy, you must configure the `config/deploy.r
|
|
118
118
|
|
119
119
|
### Magento Deploy Settings
|
120
120
|
|
121
|
-
| setting | default
|
122
|
-
| ------------------------------ |
|
123
|
-
| `:magento_deploy_setup_role` | `:all`
|
124
|
-
| `:magento_deploy_cache_shared` | `true`
|
125
|
-
| `:magento_deploy_languages` | `[
|
126
|
-
| `:magento_deploy_themes` | `[]`
|
127
|
-
| `:magento_deploy_jobs` | `
|
128
|
-
| `:magento_deploy_composer` | `true`
|
129
|
-
| `:magento_deploy_production` | `true`
|
130
|
-
| `:magento_deploy_no_dev` | `true`
|
131
|
-
| `:magento_deploy_maintenance` | `true`
|
132
|
-
| `:magento_deploy_confirm` | `[]`
|
133
|
-
| `:magento_deploy_chmod_d` | `2770` | Default permissions applied to all directories in the release path
|
134
|
-
| `:magento_deploy_chmod_f` | `0660` | Default permissions applied to all non-executable files in the release path
|
121
|
+
| setting | default | what it does
|
122
|
+
| ------------------------------ | -------- | ---
|
123
|
+
| `:magento_deploy_setup_role` | `:all` | Role from which primary host is chosen to run things like setup:upgrade on
|
124
|
+
| `:magento_deploy_cache_shared` | `true` | If true, cache operations are restricted to the primary node in setup role
|
125
|
+
| `:magento_deploy_languages` | `[]` | Array of languages passed to static content deploy routine
|
126
|
+
| `:magento_deploy_themes` | `[]` | Array of themes passed to static content deploy
|
127
|
+
| `:magento_deploy_jobs` | `nil` | Number of threads to use for static content deploy
|
128
|
+
| `:magento_deploy_composer` | `true` | Enables composer install behavior in the built-in deploy routine
|
129
|
+
| `:magento_deploy_production` | `true` | Enables production specific DI compilation and static content generation
|
130
|
+
| `:magento_deploy_no_dev` | `true` | Enables use of --no-dev flag on composer install
|
131
|
+
| `:magento_deploy_maintenance` | `true` | Enables use of maintenance mode while magento:setup:upgrade runs
|
132
|
+
| `:magento_deploy_confirm` | `[]` | Used to require confirmation of deployment to a set of capistrano stages
|
133
|
+
| `:magento_deploy_chmod_d` | `'2770'` | Default permissions applied to all directories in the release path
|
134
|
+
| `:magento_deploy_chmod_f` | `'0660'` | Default permissions applied to all non-executable files in the release path
|
135
135
|
| `:magento_deploy_chmod_x` | `['bin/magento']` | Default list of files in release path to set executable bit on
|
136
|
-
| `:magento_deploy_strategy` | `nil`
|
136
|
+
| `:magento_deploy_strategy` | `nil` | Can be `quick`, `standard` or `compact`
|
137
137
|
|
138
138
|
#### Example Usage
|
139
139
|
|
140
140
|
Add a line similar to the following in `config/deploy.rb` to set a custom value on one of the above settings:
|
141
141
|
|
142
142
|
```ruby
|
143
|
+
set :magento_deploy_jobs, '$(nproc)'
|
144
|
+
set :magento_deploy_themes, ['Magento/backend', 'Magento/blank']
|
143
145
|
set :magento_deploy_languages, ['en_US', 'en_CA']
|
144
146
|
```
|
145
147
|
|
146
|
-
```ruby
|
147
|
-
set :magento_deploy_composer, false
|
148
|
-
```
|
149
|
-
|
150
148
|
### Capistrano Built-Ins
|
151
149
|
|
152
150
|
For the sake of simplicity in new project setups `:linked_dirs` and `:linked_files` are pre-configured per the following.
|
@@ -154,7 +152,6 @@ For the sake of simplicity in new project setups `:linked_dirs` and `:linked_fil
|
|
154
152
|
```ruby
|
155
153
|
set :linked_files, [
|
156
154
|
'app/etc/env.php',
|
157
|
-
'app/etc/config.local.php',
|
158
155
|
'var/.setup_cronjob_status',
|
159
156
|
'var/.update_cronjob_status'
|
160
157
|
]
|
@@ -178,8 +175,6 @@ If you would like to customize the linked files or directories for your project,
|
|
178
175
|
append :linked_dirs, 'path/to/link'
|
179
176
|
```
|
180
177
|
|
181
|
-
Support for a `app/etc/config.local.php` configuration file was added to Magento 2.1.6. This file will be linked in from the `shared/app/etc` directory as of v0.6.4 of this gem. If this file is present in the project repository, the file will not be linked.
|
182
|
-
|
183
178
|
### Composer Auth Credentials
|
184
179
|
|
185
180
|
Magento 2's composer repository requires auth credentials to install. These can be set on target servers in a global composer `auth.json` file, the project's `composer.json` or by setting them in your deployment configuration using the following two settings:
|
data/capistrano-magento2.gemspec
CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ['lib']
|
29
29
|
|
30
|
-
spec.add_dependency 'capistrano', '~> 3.
|
30
|
+
spec.add_dependency 'capistrano', '~> 3.14'
|
31
31
|
|
32
|
-
spec.add_development_dependency 'bundler', '~> 2.
|
33
|
-
spec.add_development_dependency 'rake', '~>
|
32
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
33
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
34
34
|
end
|
data/lib/capistrano/magento2.rb
CHANGED
@@ -14,10 +14,6 @@ SSHKit.config.command_map[:magento] = "/usr/bin/env php -f bin/magento --"
|
|
14
14
|
module Capistrano
|
15
15
|
module Magento2
|
16
16
|
module Helpers
|
17
|
-
def magento_version
|
18
|
-
return Gem::Version::new((capture :php, "-f #{release_path}/bin/magento -- -V --no-ansi").split(' ').pop)
|
19
|
-
end
|
20
|
-
|
21
17
|
def disabled_modules
|
22
18
|
output = capture :magento, 'module:status --no-ansi'
|
23
19
|
output = output.split("disabled modules:\n", 2)[1]
|
@@ -34,24 +30,6 @@ module Capistrano
|
|
34
30
|
end
|
35
31
|
|
36
32
|
module Setup
|
37
|
-
def static_content_deploy params
|
38
|
-
if magento_version >= Gem::Version.new('2.2.0-rc')
|
39
|
-
# Using -f here just in case MAGE_MODE environment variable in shell is set to something other than production
|
40
|
-
execute :magento, "setup:static-content:deploy -f #{params}"
|
41
|
-
else
|
42
|
-
# Sets pipefail option in shell allowing command exit codes to halt execution when piping command output
|
43
|
-
if not SSHKit.config.command_map[:magento].include? 'set -o pipefail' # avoids trouble on multi-host deploys
|
44
|
-
@@pipefail_less = SSHKit.config.command_map[:magento].dup
|
45
|
-
SSHKit.config.command_map[:magento] = "set -o pipefail; #{@@pipefail_less}"
|
46
|
-
end
|
47
|
-
|
48
|
-
execute :magento, "setup:static-content:deploy #{params} | stdbuf -o0 tr -d ."
|
49
|
-
|
50
|
-
# Unsets pipefail option in shell so it won't affect future command executions
|
51
|
-
SSHKit.config.command_map[:magento] = @@pipefail_less
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
33
|
def deployed_version
|
56
34
|
# Generate a static content version string, but only if one has not already been set on a previous call
|
57
35
|
if not fetch(:magento_static_deployed_version)
|
@@ -9,14 +9,12 @@
|
|
9
9
|
|
10
10
|
set :linked_files, fetch(:linked_files, []).push(
|
11
11
|
'app/etc/env.php',
|
12
|
-
'app/etc/config.local.php',
|
13
12
|
'var/.setup_cronjob_status',
|
14
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
|
-
'app/etc/config.local.php',
|
20
18
|
'var/.setup_cronjob_status',
|
21
19
|
'var/.update_cronjob_status'
|
22
20
|
)
|
@@ -47,13 +45,13 @@ set :magento_deploy_chmod_x, fetch(:magento_deploy_chmod_x, ['bin/magento'])
|
|
47
45
|
# deploy configuration defaults
|
48
46
|
set :magento_deploy_composer, fetch(:magento_deploy_composer, true)
|
49
47
|
set :magento_deploy_confirm, fetch(:magento_deploy_confirm, [])
|
50
|
-
set :magento_deploy_languages, fetch(:magento_deploy_languages, [
|
48
|
+
set :magento_deploy_languages, fetch(:magento_deploy_languages, [])
|
51
49
|
set :magento_deploy_maintenance, fetch(:magento_deploy_maintenance, true)
|
52
50
|
set :magento_deploy_production, fetch(:magento_deploy_production, true)
|
53
51
|
set :magento_deploy_no_dev, fetch(:magento_deploy_no_dev, true)
|
54
52
|
set :magento_deploy_themes, fetch(:magento_deploy_themes, [])
|
55
|
-
set :magento_deploy_jobs, fetch(:magento_deploy_jobs, nil)
|
56
|
-
set :magento_deploy_strategy, fetch(:magento_deploy_strategy, nil)
|
53
|
+
set :magento_deploy_jobs, fetch(:magento_deploy_jobs, nil)
|
54
|
+
set :magento_deploy_strategy, fetch(:magento_deploy_strategy, nil)
|
57
55
|
|
58
56
|
# deploy targetting defaults
|
59
57
|
set :magento_deploy_setup_role, fetch(:magento_deploy_setup_role, :all)
|
@@ -11,7 +11,6 @@ include Capistrano::Magento2::Helpers
|
|
11
11
|
|
12
12
|
namespace :deploy do
|
13
13
|
before 'deploy:check:linked_files', 'magento:deploy:check'
|
14
|
-
before 'deploy:symlink:linked_files', 'magento:deploy:local_config'
|
15
14
|
|
16
15
|
# If both 'scopes' and 'themes' are available in app/etc/config.php then the build should not require database or
|
17
16
|
# cache backend configuration to deploy. Removing the link to app/etc/env.php in this case prevents any possible
|
@@ -50,7 +49,6 @@ namespace :deploy do
|
|
50
49
|
task :updated do
|
51
50
|
invoke 'magento:deploy:verify'
|
52
51
|
invoke 'magento:composer:install' if fetch(:magento_deploy_composer)
|
53
|
-
invoke 'magento:deploy:version_check'
|
54
52
|
invoke 'magento:setup:permissions'
|
55
53
|
|
56
54
|
if fetch(:magento_deploy_production)
|
@@ -77,17 +75,8 @@ namespace :deploy do
|
|
77
75
|
end
|
78
76
|
end
|
79
77
|
|
80
|
-
|
81
|
-
|
82
|
-
within release_path do
|
83
|
-
if test :magento, 'app:config:import --help >/dev/null 2>&1'
|
84
|
-
if not fetch(:magento_internal_zero_down_flag)
|
85
|
-
invoke 'magento:app:config:import'
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
78
|
+
invoke 'magento:cache:flush' if not fetch(:magento_internal_zero_down_flag)
|
79
|
+
invoke 'magento:app:config:import' if not fetch(:magento_internal_zero_down_flag)
|
91
80
|
invoke 'magento:setup:db:schema:upgrade' if not fetch(:magento_internal_zero_down_flag)
|
92
81
|
invoke 'magento:setup:db:data:upgrade' if not fetch(:magento_internal_zero_down_flag)
|
93
82
|
|
@@ -31,6 +31,15 @@ namespace :magento do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
desc 'Checks if config propagation requires update'
|
36
|
+
task :status do
|
37
|
+
on primary fetch(:magento_deploy_setup_role) do
|
38
|
+
within release_path do
|
39
|
+
execute :magento, 'app:config:status'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
34
43
|
end
|
35
44
|
end
|
36
45
|
|
@@ -42,6 +51,7 @@ namespace :magento do
|
|
42
51
|
execute :magento, 'cache:flush'
|
43
52
|
end
|
44
53
|
end
|
54
|
+
Rake::Task['magento:cache:flush'].reenable ## make task perpetually callable
|
45
55
|
end
|
46
56
|
|
47
57
|
desc 'Clean Magento cache by types'
|
@@ -184,19 +194,6 @@ namespace :magento do
|
|
184
194
|
end
|
185
195
|
end
|
186
196
|
|
187
|
-
task :version_check do
|
188
|
-
on release_roles(:all), in: :sequence, wait: 1 do
|
189
|
-
within release_path do
|
190
|
-
_magento_version = magento_version
|
191
|
-
unless _magento_version >= Gem::Version.new('2.1.1')
|
192
|
-
error "\e[0;31mVersion 0.7.0 and later of this gem only support deployment of Magento 2.1.1 or newer; " +
|
193
|
-
"attempted to deploy v" + _magento_version.to_s + ". Please try again using an earlier version of this gem!\e[0m"
|
194
|
-
exit 1 # only need to check a single server, exit immediately
|
195
|
-
end
|
196
|
-
end
|
197
|
-
end
|
198
|
-
end
|
199
|
-
|
200
197
|
task :check do
|
201
198
|
on release_roles :all do
|
202
199
|
next unless any? :linked_files_touch
|
@@ -231,17 +228,6 @@ namespace :magento do
|
|
231
228
|
end
|
232
229
|
exit 1 if is_err
|
233
230
|
end
|
234
|
-
|
235
|
-
task :local_config do
|
236
|
-
on release_roles :all do
|
237
|
-
if test "[ -f #{release_path}/app/etc/config.local.php ]"
|
238
|
-
info "The repository contains app/etc/config.local.php, removing from :linked_files list."
|
239
|
-
_linked_files = fetch(:linked_files, [])
|
240
|
-
_linked_files.delete('app/etc/config.local.php')
|
241
|
-
set :linked_files, _linked_files
|
242
|
-
end
|
243
|
-
end
|
244
|
-
end
|
245
231
|
end
|
246
232
|
|
247
233
|
namespace :setup do
|
@@ -258,7 +244,7 @@ namespace :magento do
|
|
258
244
|
end
|
259
245
|
|
260
246
|
namespace :db do
|
261
|
-
desc 'Checks if
|
247
|
+
desc 'Checks if DB schema or data requires upgrade'
|
262
248
|
task :status do
|
263
249
|
on primary fetch(:magento_deploy_setup_role) do
|
264
250
|
within release_path do
|
@@ -320,12 +306,7 @@ namespace :magento do
|
|
320
306
|
on release_roles :all do
|
321
307
|
within release_path do
|
322
308
|
with mage_mode: :production do
|
323
|
-
|
324
|
-
|
325
|
-
# 2.1.x doesn't return a non-zero exit code for certain errors (see davidalger/capistrano-magento2#41)
|
326
|
-
if output.to_s.include? 'Errors during compilation'
|
327
|
-
raise Exception, 'DI compilation command execution failed'
|
328
|
-
end
|
309
|
+
execute :magento, "setup:di:compile"
|
329
310
|
end
|
330
311
|
end
|
331
312
|
end
|
@@ -337,62 +318,36 @@ namespace :magento do
|
|
337
318
|
task :deploy do
|
338
319
|
on release_roles :all do
|
339
320
|
with mage_mode: :production do
|
340
|
-
|
321
|
+
deploy_languages = fetch(:magento_deploy_languages)
|
322
|
+
if deploy_languages.count() > 0
|
323
|
+
deploy_languages = deploy_languages.join(' -l ').prepend(' -l ')
|
324
|
+
else
|
325
|
+
deploy_languages = nil
|
326
|
+
end
|
341
327
|
|
342
328
|
deploy_themes = fetch(:magento_deploy_themes)
|
343
|
-
deploy_jobs = fetch(:magento_deploy_jobs)
|
344
|
-
|
345
329
|
if deploy_themes.count() > 0
|
346
330
|
deploy_themes = deploy_themes.join(' -t ').prepend(' -t ')
|
347
331
|
else
|
348
332
|
deploy_themes = nil
|
349
333
|
end
|
350
334
|
|
335
|
+
deploy_jobs = fetch(:magento_deploy_jobs)
|
351
336
|
if deploy_jobs
|
352
|
-
deploy_jobs = "--jobs #{deploy_jobs}
|
337
|
+
deploy_jobs = " --jobs #{deploy_jobs}"
|
353
338
|
else
|
354
339
|
deploy_jobs = nil
|
355
340
|
end
|
356
341
|
|
357
|
-
#
|
358
|
-
# language must be iterated individually. See issue #72 for details.
|
359
|
-
if _magento_version >= Gem::Version.new('2.1.3')
|
360
|
-
deploy_languages = fetch(:magento_deploy_languages)
|
361
|
-
else
|
362
|
-
deploy_languages = [fetch(:magento_deploy_languages).join(' ')]
|
363
|
-
end
|
364
|
-
|
365
|
-
# Magento 2.2 introduced static content compilation strategies that can be one of the following:
|
342
|
+
# Static content compilation strategies that can be one of the following:
|
366
343
|
# quick (default), standard (like previous versions) or compact
|
367
344
|
compilation_strategy = fetch(:magento_deploy_strategy)
|
368
|
-
if compilation_strategy
|
369
|
-
compilation_strategy = "-s #{compilation_strategy}
|
370
|
-
else
|
371
|
-
compilation_strategy = nil
|
345
|
+
if compilation_strategy
|
346
|
+
compilation_strategy = " -s #{compilation_strategy}"
|
372
347
|
end
|
373
348
|
|
374
349
|
within release_path do
|
375
|
-
|
376
|
-
execute :touch, "#{release_path}/pub/static/deployed_version.txt"
|
377
|
-
|
378
|
-
# This loop exists to support deploy on versions where each language must be deployed seperately
|
379
|
-
deploy_languages.each do |lang|
|
380
|
-
static_content_deploy "#{compilation_strategy}#{deploy_jobs}#{lang}#{deploy_themes}"
|
381
|
-
end
|
382
|
-
end
|
383
|
-
|
384
|
-
# Run again with HTTPS env var set to 'on' to pre-generate secure versions of RequireJS configs. A
|
385
|
-
# single run on these Magento versions will fail to generate the secure requirejs-config.js file.
|
386
|
-
if _magento_version < Gem::Version.new('2.1.8')
|
387
|
-
deploy_flags = ['css', 'less', 'images', 'fonts', 'html', 'misc', 'html-minify']
|
388
|
-
.join(' --no-').prepend(' --no-');
|
389
|
-
|
390
|
-
within release_path do with(https: 'on') {
|
391
|
-
# This loop exists to support deploy on versions where each language must be deployed seperately
|
392
|
-
deploy_languages.each do |lang|
|
393
|
-
static_content_deploy "#{compilation_strategy}#{deploy_jobs}#{lang}#{deploy_themes}#{deploy_flags}"
|
394
|
-
end
|
395
|
-
} end
|
350
|
+
execute :magento, "setup:static-content:deploy#{compilation_strategy}#{deploy_jobs}#{deploy_languages}#{deploy_themes}"
|
396
351
|
end
|
397
352
|
|
398
353
|
# Set the deployed_version of static content to ensure it matches across all hosts
|
@@ -450,51 +405,43 @@ namespace :magento do
|
|
450
405
|
end
|
451
406
|
|
452
407
|
within release_path do
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
info "Checking database status..."
|
458
|
-
# Check setup:db:status output and disable maintenance mode if all modules are up-to-date
|
459
|
-
database_status = capture :magento, 'setup:db:status', raise_on_non_zero_exit: false
|
460
|
-
|
461
|
-
if database_status.to_s.include? 'All modules are up to date'
|
462
|
-
info "All modules are up to date. No database updates should occur during this release."
|
463
|
-
info ""
|
464
|
-
disable_maintenance = true
|
465
|
-
else
|
466
|
-
puts " #{database_status.gsub("\n", "\n ").sub("Run 'setup:upgrade' to update your DB schema and data.", "")}"
|
467
|
-
end
|
408
|
+
info "Checking database status..."
|
409
|
+
# Check setup:db:status output and if out-of-date do not disable maintenance mode
|
410
|
+
database_status = capture :magento, 'setup:db:status', raise_on_non_zero_exit: false
|
411
|
+
database_uptodate = false
|
468
412
|
|
469
|
-
|
470
|
-
info "
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
end
|
413
|
+
if database_status.to_s.include? 'All modules are up to date'
|
414
|
+
info "All modules are up to date."
|
415
|
+
info ""
|
416
|
+
database_uptodate = true
|
417
|
+
else
|
418
|
+
puts " #{database_status.gsub("\n", "\n ").sub(" Run 'setup:upgrade' to update your DB schema and data.", "")}"
|
419
|
+
end
|
477
420
|
|
478
|
-
|
479
|
-
|
480
|
-
|
421
|
+
# Check app:config:status output and if out-of-date do not disable maintenance mode
|
422
|
+
info "Checking config status..."
|
423
|
+
config_status = capture :magento, 'app:config:status', raise_on_non_zero_exit: false
|
424
|
+
config_uptodate = false
|
481
425
|
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
info ""
|
426
|
+
if config_status.to_s.include? 'Config files are up to date'
|
427
|
+
info "Config files are up to date."
|
428
|
+
config_uptodate = true
|
429
|
+
else
|
430
|
+
puts " #{config_status.gsub("\n", "\n ").sub(" Run app:config:import or setup:upgrade command to synchronize configuration.", "")}"
|
488
431
|
end
|
432
|
+
info ""
|
489
433
|
|
490
|
-
|
491
|
-
|
434
|
+
# If both checks above reported up-to-date status checks disable maintenance mode
|
435
|
+
if database_uptodate and config_uptodate
|
436
|
+
disable_maintenance = true
|
492
437
|
end
|
493
438
|
|
494
439
|
if maintenance_enabled
|
440
|
+
info "Disabling maintenance mode management..."
|
495
441
|
info "Maintenance mode was already active prior to deploy."
|
496
442
|
set :magento_deploy_maintenance, false
|
497
443
|
elsif disable_maintenance
|
444
|
+
info "Disabling maintenance mode management..."
|
498
445
|
info "There are no database updates or config changes. This is a zero-down deployment."
|
499
446
|
set :magento_internal_zero_down_flag, true # Set internal flag to stop db schema/data upgrades from running
|
500
447
|
set :magento_deploy_maintenance, false # Disable maintenance mode management since it is not neccessary
|
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.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Alger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.14'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.14'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2.
|
33
|
+
version: '2.1'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '2.
|
40
|
+
version: '2.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13.0'
|
55
55
|
description: A Capistrano extension for Magento 2 deployments. Takes care of specific
|
56
56
|
Magento 2 requirements and adds tasks specific to the Magento 2 application.
|
57
57
|
email:
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
|
-
rubygems_version: 3.
|
103
|
+
rubygems_version: 3.1.2
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: A Capistrano extension for Magento 2 deployments.
|