capistrano-sozo_magento2 1.3.0 → 1.3.1

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
  SHA256:
3
- metadata.gz: 84cc07edb383402a00fb355b8b4b60bcf888916e9b26fb4fe7ba9343532df464
4
- data.tar.gz: 828a269fcce6b08dd2d1d537e2fd9f1487615bfc2fe91c618217b6f5e9977e0f
3
+ metadata.gz: 1b1790fdeb92ff66403be9ccd3f3977ad51383a401deeb09d073e927f1dff17f
4
+ data.tar.gz: 38e34911ea738869e55fe0d0fe5b5e6baad4207a7af91fbbbcae8a615f1b6208
5
5
  SHA512:
6
- metadata.gz: 8e60dbae8730826a6d503297040534fe91db718a8e075bd7076eb4779bedb73202b7efafb6ef8bdbb015dd04cf083b839943650dd7524ff7cf130d4547cd11b1
7
- data.tar.gz: 3dfd136cd8afdef71e728db387c87c8cb52a7d376b8902e8d6922281fcf0f5ca847fbbad05562abd8f3658b146c4f1a5b8b8b3aee5b2e7f80d106696ff116cc2
6
+ metadata.gz: 81a868673b25d2ee710b90dba9be7b478b48dbe80b5c238dcdbe493e6255d6647202b619b6bb0c9d71c2c34632d7757450252193e1f218e571dba14dd3dd9e00
7
+ data.tar.gz: 3125ca35d6f5e0b0ef62cf3283fdf9f97935e5ff3a56268ac8c52c231ff7c36459084f9d72a174a5b60b073a9dd9fe557250e4d81bcede40f30852d38e688547
data/CHANGELOG.md CHANGED
@@ -21,6 +21,13 @@ Given a version number MAJOR.MINOR.PATCH, increment the:
21
21
 
22
22
  ## [Unreleased]
23
23
 
24
+
25
+ ## [v1.3.1] - 2021-07-29
26
+ ### Changed
27
+ - Changed ENV options for WordPress plugins and themes removal.
28
+ - Multi-PHP support via ability to pass PHP version via the command map.
29
+
30
+
24
31
  ## [v1.3.0] - 2021-05-14
25
32
  ### Added
26
33
  - New task to check for ece-patches file `.magento.env.yaml` and to apply if it finds one.
data/README.md CHANGED
@@ -62,6 +62,20 @@ If you would like to customize the linked files or directories for your project,
62
62
  append :linked_dirs, 'path/to/link'
63
63
  ```
64
64
 
65
+ ## Command Mapping
66
+ The module assumes the following bin files are in the following locations:
67
+ 1. `php` in your path accessible from the command line as php
68
+ 2. `composer` in `/usr/local/bin/composer`
69
+ 3. `n98-magerun` in `/usr/local/bin/n98-magerun`
70
+
71
+ Composer and n98-magerun command are both prefixed with the PHP path (for multi-php support), if you are overwriting these commands via the command map you will need to include the php bin in your `stage.rb` file similar to the following.
72
+ ```
73
+ SSHKit.config.command_map[:php] = '/usr/bin/env php74 -dmemory_limit=-1'
74
+ SSHKit.config.command_map[:composer] = SSHKit.config.command_map[:php], '-f /usr/local/bin/composer'
75
+ SSHKit.config.command_map[:n98magerun] = SSHKit.config.command_map[:php], '-f /usr/local/bin/n98-magerun'
76
+ SSHKit.config.command_map[:magento] = SSHKit.config.command_map[:php], '-f bin/magento --'
77
+ ```
78
+
65
79
  ## Versioning
66
80
  We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/sozo-design/capistrano-sozo-magento2/tags) or [CHANGELOG.md](./CHANGELOG.md).
67
81
 
@@ -1,8 +1,9 @@
1
1
  require 'date'
2
2
 
3
- SSHKit.config.command_map[:composer] = 'php -dmemory_limit=-1 -f /usr/local/bin/composer'
4
- SSHKit.config.command_map[:n98magerun] = '/usr/local/bin/n98-magerun'
5
- SSHKit.config.command_map[:magento] = "/usr/bin/env php -d memory_limit=1G -f bin/magento --"
3
+ SSHKit.config.command_map[:php] = '/usr/bin/env php -dmemory_limit=-1'
4
+ SSHKit.config.command_map[:composer] = SSHKit.config.command_map[:php], '-f /usr/local/bin/composer'
5
+ SSHKit.config.command_map[:n98magerun] = SSHKit.config.command_map[:php], '-f /usr/local/bin/n98-magerun'
6
+ SSHKit.config.command_map[:magento] = SSHKit.config.command_map[:php], '-f bin/magento --'
6
7
 
7
8
  load File.expand_path('../tasks/sozo_magento2.rake', __FILE__)
8
9
  load File.expand_path('../tasks/deploy.rake', __FILE__)
@@ -42,8 +43,8 @@ after 'deploy:finishing', 'magento:maintenance:disable'
42
43
  after 'deploy:finished', "slack:deployed"
43
44
  after 'deploy:finished', "db:cleanup"
44
45
 
45
- after 'deploy:failed', "slack:failed"
46
46
  after 'deploy:failed', "sozo:fix_current"
47
+ after 'deploy:failed', "slack:failed"
47
48
  after 'deploy:failed', 'magento:maintenance:disable'
48
49
 
49
50
  namespace :load do
@@ -27,9 +27,14 @@ set :composer_require_dev_flags, '--optimize-autoloader --prefer-dist'
27
27
  set :date_path, Time.now.strftime("%Y%m%d%H%M%S")
28
28
  set :backupdir, ->{ "#{fetch(:deploy_root)}/backups" }
29
29
  set :backupdirdate, ->{ "#{fetch(:backupdir)}/#{fetch(:date_path)}" }
30
- set :wp_backup, fetch(:wp_backup, true)
31
30
  set :keep_backups, fetch(:keep_backups, 10)
32
31
 
32
+ # WordPress integration defaults
33
+ set :wp_backup, fetch(:wp_backup, true)
34
+ set :wp_delete_themes, fetch(:wp_delete_themes, 'twentyseventeen twentynineteen twentytwenty')
35
+ set :wp_delete_plugins, fetch(:wp_delete_plugins, 'hello')
36
+ set :wp_disable_plugins, fetch(:wp_disable_plugins, '')
37
+
33
38
  # Slack defaults
34
39
  set :slack_channel, fetch(:slack_channel, '#deployments')
35
40
  set :slack_webhook, 'https://hooks.slack.com/services/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'
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module SozoMagento2
3
- VERSION = "1.3.0"
3
+ VERSION = "1.3.1"
4
4
  end
5
5
  end
@@ -5,7 +5,7 @@ namespace :magento do
5
5
  task :flush do
6
6
  on release_roles :all do
7
7
  within release_path do
8
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'cache:flush'
8
+ execute :php, '-f', 'magento/bin/magento', 'cache:flush'
9
9
  end
10
10
  end
11
11
  end
@@ -14,7 +14,7 @@ namespace :magento do
14
14
  task :clean do
15
15
  on release_roles :all do
16
16
  within release_path do
17
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'cache:clean'
17
+ execute :php, '-f', 'magento/bin/magento', 'cache:clean'
18
18
  end
19
19
  end
20
20
  end
@@ -24,7 +24,7 @@ namespace :magento do
24
24
  on release_roles :all do
25
25
  within release_path do
26
26
  if File.exist?("magento/bin/magento")
27
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'cache:enable', 'config layout block_html collections reflection db_ddl eav config_integration config_integration_api full_page translate config_webservice'
27
+ execute :php, '-f', 'magento/bin/magento', 'cache:enable', 'config layout block_html collections reflection db_ddl eav config_integration config_integration_api full_page translate config_webservice'
28
28
  end
29
29
  end
30
30
  end
@@ -34,7 +34,7 @@ namespace :magento do
34
34
  task :disable do
35
35
  on release_roles :all do
36
36
  within release_path do
37
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'cache:disable'
37
+ execute :php, '-f', 'magento/bin/magento', 'cache:disable'
38
38
  end
39
39
  end
40
40
  end
@@ -43,7 +43,7 @@ namespace :magento do
43
43
  task :status do
44
44
  on release_roles :all do
45
45
  within release_path do
46
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'cache:status'
46
+ execute :php, '-f', 'magento/bin/magento', 'cache:status'
47
47
  end
48
48
  end
49
49
  end
@@ -76,7 +76,7 @@ namespace :magento do
76
76
  if test("[ -f #{release_path}/magento/app/etc/config.php ]")
77
77
  # Exists, carry on
78
78
  else
79
- execute :php, '-dmemory_limit=-1', '-f', 'bin/magento', "module:enable", "--all"
79
+ execute :php, '-f', 'bin/magento', "module:enable", "--all"
80
80
  end
81
81
  end
82
82
  end
@@ -86,7 +86,7 @@ namespace :magento do
86
86
  task 'disable', :module_name do |t, args|
87
87
  on release_roles :staging do
88
88
  within release_path + 'magento/' do
89
- execute :php, '-dmemory_limit=-1', '-f', 'bin/magento', "module:disable", args[:module_name]
89
+ execute :php, '-f', 'bin/magento', "module:disable", args[:module_name]
90
90
  end
91
91
  end
92
92
  end
@@ -95,7 +95,7 @@ namespace :magento do
95
95
  task 'enable', :module_name do |t, args|
96
96
  on release_roles :staging do
97
97
  within release_path + 'magento/' do
98
- execute :php, '-dmemory_limit=-1', '-f', 'bin/magento', "module:enable", args[:module_name], '-f'
98
+ execute :php, '-f', 'bin/magento', "module:enable", args[:module_name], '-f'
99
99
  invoke 'magento:setup:upgrade'
100
100
  invoke 'magento:setup:static-content:deploy'
101
101
  end
@@ -112,7 +112,7 @@ namespace :magento do
112
112
  within release_path + 'magento/' do
113
113
  ask(:parameter, '')
114
114
  ask(:value, '')
115
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', "setup:config:set", "--#{fetch(:parameter)}=#{fetch(:value)}", "--no-interaction"
115
+ execute :php, '-f', 'magento/bin/magento', "setup:config:set", "--#{fetch(:parameter)}=#{fetch(:value)}", "--no-interaction"
116
116
  end
117
117
  end
118
118
  end
@@ -131,7 +131,7 @@ namespace :magento do
131
131
  task :upgrade do
132
132
  on release_roles :all do
133
133
  within release_path do
134
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'setup:upgrade', '-n'
134
+ execute :php, '-f', 'magento/bin/magento', 'setup:upgrade', '-n'
135
135
  end
136
136
  end
137
137
  end
@@ -172,7 +172,7 @@ namespace :magento do
172
172
  task :compile do
173
173
  on release_roles :all do
174
174
  within release_path do
175
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'setup:di:compile'
175
+ execute :php, '-f', 'magento/bin/magento', 'setup:di:compile'
176
176
  end
177
177
  end
178
178
  end
@@ -183,7 +183,7 @@ namespace :magento do
183
183
  task :deploy do
184
184
  on release_roles :all do
185
185
  within release_path do
186
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'setup:static-content:deploy -f en_US en_GB -j6'
186
+ execute :php, '-f', 'magento/bin/magento', 'setup:static-content:deploy -f en_US en_GB -j6'
187
187
  end
188
188
  end
189
189
  end
@@ -197,7 +197,7 @@ namespace :magento do
197
197
  on release_roles :all do
198
198
  within current_path do
199
199
  if File.exist?("magento/bin/magento")
200
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'maintenance:enable'
200
+ execute :php, '-f', 'magento/bin/magento', 'maintenance:enable'
201
201
  end
202
202
  end
203
203
  end
@@ -208,7 +208,7 @@ namespace :magento do
208
208
  on release_roles :all do
209
209
  within current_path do
210
210
  if File.exist?("magento/bin/magento")
211
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'maintenance:disable'
211
+ execute :php, '-f', 'magento/bin/magento', 'maintenance:disable'
212
212
  end
213
213
  end
214
214
  end
@@ -218,7 +218,7 @@ namespace :magento do
218
218
  task :status do
219
219
  on release_roles :all do
220
220
  within current_path do
221
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'maintenance:status'
221
+ execute :php, '-f', 'magento/bin/magento', 'maintenance:status'
222
222
  end
223
223
  end
224
224
  end
@@ -227,7 +227,7 @@ namespace :magento do
227
227
  task 'allow-ips', :ip do |t, args|
228
228
  on release_roles :all do
229
229
  within current_path do
230
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'maintenance:allow-ips', args[:ip]
230
+ execute :php, '-f', 'magento/bin/magento', 'maintenance:allow-ips', args[:ip]
231
231
  end
232
232
  end
233
233
  end
@@ -238,7 +238,7 @@ namespace :magento do
238
238
  task :reindex do
239
239
  on release_roles :all do
240
240
  within release_path do
241
- execute :php, '-dmemory_limit=-1', '-f', 'magento/bin/magento', 'indexer:reindex'
241
+ execute :php, '-f', 'magento/bin/magento', 'indexer:reindex'
242
242
  end
243
243
  end
244
244
  end
@@ -251,7 +251,7 @@ namespace :magento do
251
251
  within release_path do
252
252
  if test("[ -f #{release_path}/magento/.magento.env.yaml ]")
253
253
  info 'Applying patches'
254
- execute :php, '-dmemory_limit=-1', '-f', 'magento/vendor/bin/ece-patches', 'apply --no-interaction'
254
+ execute :php, '-f', 'magento/vendor/bin/ece-patches', 'apply --no-interaction'
255
255
  else
256
256
  info 'No patch file found, skipping.'
257
257
  end
@@ -265,7 +265,7 @@ namespace :magento do
265
265
  within release_path do
266
266
  if test("[ -f #{release_path}/magento/.magento.env.yaml ]")
267
267
  info 'Reverting patches'
268
- execute :php, '-dmemory_limit=-1', '-f', 'magento/vendor/bin/ece-patches', 'revert --no-interaction'
268
+ execute :php, '-f', 'magento/vendor/bin/ece-patches', 'revert --no-interaction'
269
269
  else
270
270
  info 'No patch file found, skipping.'
271
271
  end
@@ -12,10 +12,15 @@ namespace :wordpress do
12
12
  on roles :all do |host|
13
13
  within release_path + "magento/wp/" do
14
14
  info "Removing default unused WordPress Plugins and Themes"
15
- execute :wp, 'plugin', 'delete', 'hello'
16
- execute :wp, 'theme', 'delete', 'twentyseventeen'
17
- execute :wp, 'theme', 'delete', 'twentynineteen'
18
- execute :wp, 'theme', 'delete', 'twentytwenty'
15
+ if fetch(:wp_disable_plugins).length >= 1
16
+ execute :wp, 'plugin', 'deactivate', fetch(:wp_disable_plugins)
17
+ end
18
+ if fetch(:wp_delete_plugins).length >= 1
19
+ execute :wp, 'plugin', 'delete', fetch(:wp_delete_plugins)
20
+ end
21
+ if fetch(:wp_delete_themes).length >= 1
22
+ execute :wp, 'theme', 'delete', fetch(:wp_delete_themes)
23
+ end
19
24
  execute :rm, '-f', 'readme.html'
20
25
  end
21
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-sozo_magento2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clive Walkden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-14 00:00:00.000000000 Z
11
+ date: 2021-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano