capistrano-sozo_magento2 1.7.0 → 1.9.0
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 +4 -4
- data/.ruby-version +1 -0
- data/CHANGELOG.md +10 -0
- data/README.md +3 -1
- data/lib/capistrano/sozo_magento2/defaults.rb +1 -0
- data/lib/capistrano/sozo_magento2/info.rb +1 -0
- data/lib/capistrano/sozo_magento2/version.rb +1 -1
- data/lib/capistrano/sozo_magento2.rb +3 -0
- data/lib/capistrano/tasks/cron.rake +27 -0
- data/lib/capistrano/tasks/magento2.rake +11 -1
- data/lib/capistrano/tasks/server.rake +7 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b35a3ce9389d3b8273c170ddeff453f30b19d401031d89903be64e874ba3823f
|
4
|
+
data.tar.gz: 7f02072605823586b01595a3d28dce4865c45b347b473e5eacf8ca33b1e4d596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f995340c4dc6cbdc6c84b433bc3e9caab829653a02590b7f71e9d2aeb94c449629ecd8f0c91287863f8c8543489acc4a86b26e359740c46a99532120cea6fc91
|
7
|
+
data.tar.gz: 0e194ab4a6b8267435483b4cc3a85f9a4cabfc006de3bb07da4293de339bf5d7ea670313269b32cb53a1a5d24f36cdc1cc361ae0de253750ba1fc90ec36ddcc0
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.3
|
data/CHANGELOG.md
CHANGED
@@ -21,6 +21,16 @@ Given a version number MAJOR.MINOR.PATCH, increment the:
|
|
21
21
|
|
22
22
|
## [Unreleased]
|
23
23
|
|
24
|
+
## [v1.9.0] - 2022-11-18
|
25
|
+
### Added
|
26
|
+
- WP binary override
|
27
|
+
|
28
|
+
|
29
|
+
## [v1.8.0] - 2022-10-14
|
30
|
+
### Added
|
31
|
+
- varnish role added to restart varnish service
|
32
|
+
- Ability to completely clear long running cron tasks to stop multiple crons running simultaneously
|
33
|
+
|
24
34
|
|
25
35
|
## [v1.7.0] - 2022-09-22
|
26
36
|
### Changed
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ It is advised to use bundler.
|
|
7
7
|
|
8
8
|
1. Add the following to your projects `Gemfile`
|
9
9
|
```
|
10
|
-
gem "capistrano-sozo_magento2", "~> 1.
|
10
|
+
gem "capistrano-sozo_magento2", "~> 1.9"
|
11
11
|
```
|
12
12
|
2. Install
|
13
13
|
```
|
@@ -76,7 +76,9 @@ Composer and n98-magerun command are both prefixed with the PHP path (for multi-
|
|
76
76
|
SSHKit.config.command_map[:php] = '/usr/bin/env php74 -dmemory_limit=-1'
|
77
77
|
SSHKit.config.command_map[:composer] = SSHKit.config.command_map[:php], '-f /usr/local/bin/composer'
|
78
78
|
SSHKit.config.command_map[:n98magerun] = SSHKit.config.command_map[:php], '-f /usr/local/bin/n98-magerun'
|
79
|
+
SSHKit.config.command_map[:wp] = SSHKit.config.command_map[:php], '-f /usr/local/bin/wp'
|
79
80
|
SSHKit.config.command_map[:magento] = SSHKit.config.command_map[:php], '-f bin/magento --'
|
81
|
+
SSHKit.config.command_map[:app_controller] = 'sudo /usr/bin/systemctl'
|
80
82
|
```
|
81
83
|
|
82
84
|
## Versioning
|
@@ -45,6 +45,7 @@ set :magento_deploy_confirm_roles, fetch(:magento_deploy_confirm_roles, [])
|
|
45
45
|
|
46
46
|
# Handle removing and installing of cron tasks?
|
47
47
|
set :handle_cron, fetch(:handle_cron, false)
|
48
|
+
set :clear_cron, fetch(:clear_cron, false)
|
48
49
|
|
49
50
|
# Other defaults (for future use)
|
50
51
|
# Clear or leave the failed deployment dirs
|
@@ -3,7 +3,9 @@ require 'date'
|
|
3
3
|
SSHKit.config.command_map[:php] = '/usr/bin/env php -dmemory_limit=-1'
|
4
4
|
SSHKit.config.command_map[:composer] = SSHKit.config.command_map[:php], '-f /usr/local/bin/composer'
|
5
5
|
SSHKit.config.command_map[:n98magerun] = SSHKit.config.command_map[:php], '-f /usr/local/bin/n98-magerun'
|
6
|
+
SSHKit.config.command_map[:wp] = SSHKit.config.command_map[:php], '-f /usr/local/bin/wp'
|
6
7
|
SSHKit.config.command_map[:magento] = SSHKit.config.command_map[:php], '-f bin/magento --'
|
8
|
+
SSHKit.config.command_map[:app_controller] = 'sudo /usr/bin/systemctl'
|
7
9
|
|
8
10
|
load File.expand_path('../tasks/sozo_magento2.rake', __FILE__)
|
9
11
|
load File.expand_path('../tasks/deploy.rake', __FILE__)
|
@@ -15,6 +17,7 @@ load File.expand_path('../tasks/magento2.rake', __FILE__)
|
|
15
17
|
load File.expand_path('../tasks/provision.rake', __FILE__)
|
16
18
|
load File.expand_path('../tasks/server.rake', __FILE__)
|
17
19
|
load File.expand_path('../tasks/wordpress.rake', __FILE__)
|
20
|
+
load File.expand_path('../tasks/cron.rake', __FILE__)
|
18
21
|
|
19
22
|
after 'deploy:check', 'sozo:git:check'
|
20
23
|
after 'deploy:check', 'sozo:info'
|
@@ -0,0 +1,27 @@
|
|
1
|
+
namespace :cron do
|
2
|
+
desc 'Cleanup cron tasks that shouldn\'t be running'
|
3
|
+
task :cleanup do
|
4
|
+
on release_roles :all do
|
5
|
+
if (fetch(:clear_cron).to_s == "true")
|
6
|
+
info "Stopping cron daemon"
|
7
|
+
execute :app_controller, "stop", "crond"
|
8
|
+
|
9
|
+
info "Killing current cron tasks"
|
10
|
+
execute :sudo, "pkill", "-u", "#{fetch(:username)}", "-f", "'cron|consumer'", "||", "true"
|
11
|
+
|
12
|
+
within fetch(:deploy_root) + '/magento2/' do
|
13
|
+
info "Removing Magento cron tasks"
|
14
|
+
execute :rm, "-rf", "var/cron/*"
|
15
|
+
|
16
|
+
info "Truncating cron_schedule table"
|
17
|
+
execute :n98magerun, "db:query", '"truncate cron_schedule;"'
|
18
|
+
end
|
19
|
+
|
20
|
+
info "Starting cron daemon"
|
21
|
+
execute :app_controller, "start", "crond"
|
22
|
+
else
|
23
|
+
info "Cron Clear not controlled by capistrano"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -10,6 +10,7 @@ namespace :magento do
|
|
10
10
|
else
|
11
11
|
info "Cron not controlled by capistrano"
|
12
12
|
end
|
13
|
+
invoke 'cron:cleanup'
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
@@ -157,7 +158,16 @@ namespace :magento do
|
|
157
158
|
task :upgrade do
|
158
159
|
on release_roles :all do
|
159
160
|
within release_path do
|
160
|
-
|
161
|
+
# Check if an upgrade is required capture the setup:db:status output
|
162
|
+
#check = capture(:php, '-f', 'magento/bin/magento', 'setup:db:status', '--no-ansi')
|
163
|
+
#debug "#{check}"
|
164
|
+
|
165
|
+
#if !check.start_with?("All")
|
166
|
+
# info "Setup upgrade required"
|
167
|
+
execute :php, '-f', 'magento/bin/magento', 'setup:upgrade', '-n'
|
168
|
+
#else
|
169
|
+
# info "Modules are all up to date, no database upgrade required!"
|
170
|
+
#end
|
161
171
|
end
|
162
172
|
end
|
163
173
|
end
|
@@ -2,10 +2,15 @@ namespace :server do
|
|
2
2
|
namespace :service do
|
3
3
|
desc "Restart the server services"
|
4
4
|
task :restart do
|
5
|
+
on roles(:varnish) do
|
6
|
+
within release_path do
|
7
|
+
execute :app_controller, "restart", "varnish"
|
8
|
+
end
|
9
|
+
end
|
5
10
|
on roles(:gcloud, :aws, :cloud, :dedicated) do
|
6
11
|
within release_path do
|
7
|
-
execute :
|
8
|
-
execute :
|
12
|
+
execute :app_controller, "restart", "php-fpm"
|
13
|
+
execute :app_controller, "restart", "nginx"
|
9
14
|
end
|
10
15
|
end
|
11
16
|
on roles(:cluster) do
|
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.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clive Walkden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -32,6 +32,7 @@ extensions: []
|
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
34
|
- ".gitignore"
|
35
|
+
- ".ruby-version"
|
35
36
|
- ".yardopts"
|
36
37
|
- BUILD.md
|
37
38
|
- CHANGELOG.md
|
@@ -45,6 +46,7 @@ files:
|
|
45
46
|
- lib/capistrano/sozo_magento2/slack.rb
|
46
47
|
- lib/capistrano/sozo_magento2/version.rb
|
47
48
|
- lib/capistrano/tasks/composer.rake
|
49
|
+
- lib/capistrano/tasks/cron.rake
|
48
50
|
- lib/capistrano/tasks/db.rake
|
49
51
|
- lib/capistrano/tasks/deploy.rake
|
50
52
|
- lib/capistrano/tasks/magento2.rake
|