capistrano-sozo_magento2 1.7.0 → 1.8.0

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
  SHA256:
3
- metadata.gz: 923ebdbd8e0af793979bc643b64dcf620b6a41339e7a0a37fd1493d4c0ebe394
4
- data.tar.gz: 96129ba2ee73f1f05a3e920676b8b70ed3dc1b0a2e70e500c31c19c0f75cfca1
3
+ metadata.gz: 30ddb4232948b060b40cd21385c277fa47f3f047838b461320638b8a46a7fa72
4
+ data.tar.gz: 483615f92d6c6f94088702fad14bed24ed4048cd583a0bde96b2182dea144954
5
5
  SHA512:
6
- metadata.gz: 0a084753174d86a81c8af5fa6b4b6334121688f924cddabdb0107f34012d09db7a6106531e058de9fc833a256170f18f23597a1cb640cde3ab94f345e07991c5
7
- data.tar.gz: 8b2e192b898f69a731df2f1e38a1fcd83bd01691eefe336cb88e848a00957043d8432919827c09e8248dca394a36ef7b736ff1f8aadae7541edca3075bfc4b49
6
+ metadata.gz: 1c9408af646a0cebe70f06de570403d5ffb40be9fb292c957d638abdc26619454c7c1192c2ec01f44fcde9c563b1e3f682bb6c4fedf5668286aebb40b6cca159
7
+ data.tar.gz: 28af1de39d23d75249378353572187456f9f5902a073ee1252fa947684da126a050080a5ffae30458f7edf44b421e67b330b3d09de775d37cd766f3a595bb0f8
data/CHANGELOG.md CHANGED
@@ -21,6 +21,11 @@ Given a version number MAJOR.MINOR.PATCH, increment the:
21
21
 
22
22
  ## [Unreleased]
23
23
 
24
+ ## [v1.8.0] - 2022-10-14
25
+ ### Added
26
+ - varnish role added to restart varnish service
27
+ - Ability to completely clear long running cron tasks to stop multiple crons running simultaneously
28
+
24
29
 
25
30
  ## [v1.7.0] - 2022-09-22
26
31
  ### 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.6"
10
+ gem "capistrano-sozo_magento2", "~> 1.8"
11
11
  ```
12
12
  2. Install
13
13
  ```
@@ -77,6 +77,7 @@ 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
79
  SSHKit.config.command_map[:magento] = SSHKit.config.command_map[:php], '-f bin/magento --'
80
+ SSHKit.config.command_map[:app_controller] = 'sudo /usr/bin/systemctl'
80
81
  ```
81
82
 
82
83
  ## 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
@@ -12,6 +12,7 @@ module SozoMagento2
12
12
  branch
13
13
  environment
14
14
  handle_cron
15
+ clear_cron
15
16
  slack_channel
16
17
  url
17
18
  ).freeze
@@ -4,6 +4,6 @@ module Capistrano
4
4
  module SozoMagento2
5
5
  # The plugin version number
6
6
  # @return [String] The gem version number
7
- VERSION = "1.7.0"
7
+ VERSION = "1.8.0"
8
8
  end
9
9
  end
@@ -4,6 +4,7 @@ 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
6
  SSHKit.config.command_map[:magento] = SSHKit.config.command_map[:php], '-f bin/magento --'
7
+ SSHKit.config.command_map[:app_controller] = 'sudo /usr/bin/systemctl'
7
8
 
8
9
  load File.expand_path('../tasks/sozo_magento2.rake', __FILE__)
9
10
  load File.expand_path('../tasks/deploy.rake', __FILE__)
@@ -15,6 +16,7 @@ load File.expand_path('../tasks/magento2.rake', __FILE__)
15
16
  load File.expand_path('../tasks/provision.rake', __FILE__)
16
17
  load File.expand_path('../tasks/server.rake', __FILE__)
17
18
  load File.expand_path('../tasks/wordpress.rake', __FILE__)
19
+ load File.expand_path('../tasks/cron.rake', __FILE__)
18
20
 
19
21
  after 'deploy:check', 'sozo:git:check'
20
22
  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
 
@@ -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 :sudo, "systemctl", "restart", "php-fpm"
8
- execute :sudo, "systemctl", "restart", "nginx"
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.7.0
4
+ version: 1.8.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-09-22 00:00:00.000000000 Z
11
+ date: 2022-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -45,6 +45,7 @@ files:
45
45
  - lib/capistrano/sozo_magento2/slack.rb
46
46
  - lib/capistrano/sozo_magento2/version.rb
47
47
  - lib/capistrano/tasks/composer.rake
48
+ - lib/capistrano/tasks/cron.rake
48
49
  - lib/capistrano/tasks/db.rake
49
50
  - lib/capistrano/tasks/deploy.rake
50
51
  - lib/capistrano/tasks/magento2.rake