capistrano-sozo_magento2 1.4.0 → 1.6.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: ab55bf423e1766857aeff0a542b1b2657e35a6401d7dda6469404df07060d90c
4
- data.tar.gz: 43a54ea1407c899c1f9545c6cb6703977ac70690053f6efdd61d18024eb933dd
3
+ metadata.gz: dcc222d9e3fc341f69b780d94f5179850bee32fc6fbf9d5ca21872eace7a72a4
4
+ data.tar.gz: 1f0aa60540f6c2b1d3d0e23200d46f6543b0c1f1f63bf42210b070c09b85efef
5
5
  SHA512:
6
- metadata.gz: 0d068c92ebcd093a49b7ca63685a0d27e898aa3884d5ecd9a5ea9b7c339eae83c700eccaab3b5ac959b2c12d20cfae7d7526376365045996e8d88e5a38802dff
7
- data.tar.gz: 42b84543c461b955f32cff824750a12b06ed8de464c5b6227915440b28f732a3d22355a0066bd38c45f425b16c58ecaa11e4d7ea6f40cbd7d078f15a5d5e39dd
6
+ metadata.gz: df41ec7d95247860cf3cd56661457fba36053378d1c4b1f600324f3a4c352183c3321555ba51b332576507c8e7df95e9ef9e9ecb80e9919fd9dbde3e5d8c2a11
7
+ data.tar.gz: 34beb143b6d773664423c93361df841495625aabacaff27e0ae17fe4cc74a94ec711f03b89ea65270fe8d025758e5b52e05914c059df89f0666c7fb638e2c4fc
data/CHANGELOG.md CHANGED
@@ -21,6 +21,39 @@ Given a version number MAJOR.MINOR.PATCH, increment the:
21
21
 
22
22
  ## [Unreleased]
23
23
 
24
+ ## [v1.6.0] - 2022-06-18
25
+ ### Added
26
+ - Ability to copy over multiple themes and specify their name.
27
+
28
+ ### Changed
29
+ - Removed `--no-suggest` from composer commands
30
+
31
+ ### Removed
32
+ - Fishpig rake file
33
+ - WordPress twentytwentytwo theme now deleted by default.
34
+
35
+ ### Fixed
36
+ - Fixed the order of reindex and cache flush.
37
+ - Fixed patch.log permissions if it exists.
38
+
39
+
40
+ ## [v1.5.1] - 2022-02-23
41
+ ### Changed
42
+ - Reverted change to magento:patches:apply
43
+
44
+
45
+ ## [v1.5.0] - 2022-02-22
46
+ ### Added
47
+ - Option to not clear files if the deployment fails via the `:clear_failures` option
48
+ - Option to await user input before putting site in maintenance mode with `:magento_deploy_confirm_roles`
49
+
50
+ ### Changed
51
+ - Deployment task order to lower site downtime.
52
+ - WordPress twentytwentyone theme removed now by default.
53
+
54
+ ### Removed
55
+ - magento:patches:apply command removed as it's part of the composer.bash ran at install time.
56
+
24
57
 
25
58
  ## [v1.4.0] - 2021-08-03
26
59
  ### Added
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.3"
10
+ gem "capistrano-sozo_magento2", "~> 1.6"
11
11
  ```
12
12
  2. Install
13
13
  ```
@@ -18,9 +18,9 @@ set :linked_dirs, fetch(:linked_dirs, []).push(
18
18
  )
19
19
 
20
20
  # Composer defaults
21
- set :composer_flags, '--no-dev --optimize-autoloader --prefer-dist --no-interaction --no-suggest'
22
- set :composer_dev_flags, '--prefer-dist --no-interaction --no-suggest'
23
- set :composer_require_flags, '--update-no-dev --optimize-autoloader --prefer-dist --no-suggest'
21
+ set :composer_flags, '--no-dev --optimize-autoloader --prefer-dist --no-interaction'
22
+ set :composer_dev_flags, '--prefer-dist --no-interaction'
23
+ set :composer_require_flags, '--update-no-dev --optimize-autoloader --prefer-dist'
24
24
  set :composer_require_dev_flags, '--optimize-autoloader --prefer-dist'
25
25
 
26
26
  # DB defaults
@@ -31,9 +31,10 @@ set :keep_backups, fetch(:keep_backups, 10)
31
31
 
32
32
  # WordPress integration defaults
33
33
  set :wp_backup, fetch(:wp_backup, true)
34
- set :wp_delete_themes, fetch(:wp_delete_themes, 'twentyseventeen twentynineteen twentytwenty')
34
+ set :wp_delete_themes, fetch(:wp_delete_themes, 'twentyseventeen twentynineteen twentytwenty twentytwentyone twentytwentytwo')
35
35
  set :wp_delete_plugins, fetch(:wp_delete_plugins, 'hello')
36
36
  set :wp_disable_plugins, fetch(:wp_disable_plugins, '')
37
+ set :wp_copy_themes, fetch(:wp_copy_themes, 'fishpig')
37
38
 
38
39
  # Slack defaults
39
40
  set :slack_channel, fetch(:slack_channel, '#deployments')
@@ -47,4 +48,4 @@ set :handle_cron, fetch(:handle_cron, false)
47
48
 
48
49
  # Other defaults (for future use)
49
50
  # Clear or leave the failed deployment dirs
50
- set :clear_failures, fetch(:clear_failures, true)
51
+ set :clear_failures, fetch(:clear_failures, true)
@@ -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.4.0"
7
+ VERSION = "1.6.0"
8
8
  end
9
9
  end
@@ -11,7 +11,6 @@ load File.expand_path('../tasks/composer.rake', __FILE__)
11
11
  load File.expand_path('../tasks/sozo.rake', __FILE__)
12
12
  load File.expand_path('../tasks/slack.rake', __FILE__)
13
13
  load File.expand_path('../tasks/db.rake', __FILE__)
14
- load File.expand_path('../tasks/fishpig.rake', __FILE__)
15
14
  load File.expand_path('../tasks/magento2.rake', __FILE__)
16
15
  load File.expand_path('../tasks/provision.rake', __FILE__)
17
16
  load File.expand_path('../tasks/server.rake', __FILE__)
@@ -24,12 +23,12 @@ after 'deploy:updating', 'composer:install'
24
23
  after 'deploy:updating', 'magento:patches:apply'
25
24
  after 'deploy:updating', 'magento:setup:permissions'
26
25
 
27
- before 'deploy:updated', 'slack:deploying'
28
26
  before 'deploy:updated', 'db:backup'
29
27
  before 'deploy:updated', 'magento:cron:remove'
30
28
  before 'deploy:updated', 'sozo:config:setup'
31
- before 'deploy:updated', 'magento:maintenance:enable'
32
29
 
30
+ after 'deploy:updated', 'slack:deploying'
31
+ after 'deploy:updated', 'magento:maintenance:enable'
33
32
  after 'deploy:updated', 'provision:setup_dir'
34
33
  after 'deploy:updated', 'magento:setup:upgrade'
35
34
  after 'deploy:updated', 'magento:setup:di:compile'
@@ -37,7 +36,7 @@ after 'deploy:updated', 'magento:setup:static-content:deploy'
37
36
  after 'deploy:updated', 'provision:permissions'
38
37
 
39
38
  after 'deploy:finishing', 'sozo:symlink'
40
- after 'deploy:finishing', 'fishpig:setup:install_theme'
39
+ after 'deploy:finishing', 'wordpress:copy_themes'
41
40
  after 'deploy:finishing', 'wordpress:sozo_mu'
42
41
  after 'deploy:finishing', 'wordpress:cleanup'
43
42
  after 'deploy:finishing', 'sozo:optimise'
@@ -58,4 +57,4 @@ namespace :load do
58
57
  task :defaults do
59
58
  load 'capistrano/sozo_magento2/defaults.rb'
60
59
  end
61
- end
60
+ end
@@ -7,6 +7,14 @@ namespace :deploy do
7
7
  end
8
8
  end
9
9
 
10
+ after :updated, :confirm_setup do
11
+ if fetch(:magento_deploy_confirm_roles).include? fetch(:stage).to_s
12
+ print "\e[0;31m Put site in maintenance mode and deploy to #{fetch(:stage).to_s}? [y/n] \e[0m"
13
+ proceed = STDIN.gets[0..0] rescue nil
14
+ exit unless proceed == 'y' || proceed == 'Y'
15
+ end
16
+ end
17
+
10
18
 
11
19
  Rake::Task["cleanup"].clear_actions
12
20
 
@@ -40,7 +48,7 @@ namespace :deploy do
40
48
  desc "Failed deployment tasks"
41
49
  task :failed do
42
50
  on release_roles :all do |host|
43
- on roles :production, :staging, :testing do
51
+ if (fetch(:clear_failures) == "true")
44
52
  # Hold for a few seconds to make sure all disk related actions have completed
45
53
  info "Waiting for file / disk writing to complete"
46
54
  sleep(3)
@@ -51,4 +59,4 @@ namespace :deploy do
51
59
  end
52
60
  end
53
61
  end
54
- end
62
+ end
@@ -292,4 +292,15 @@ namespace :magento do
292
292
  end
293
293
  end
294
294
 
295
+ namespace :fishpig do
296
+ desc 'Create and install Fishpig WordPress theme'
297
+ task :create_theme do
298
+ on release_roles :all do
299
+ within release_path do
300
+ execute :php, '-f', 'magento/bin/magento', 'fishpig:wordpress:build-theme', '--install-path=magento/wp'
301
+ end
302
+ end
303
+ end
304
+ end
305
+
295
306
  end
@@ -15,9 +15,15 @@ namespace :provision do
15
15
  execute :sudo, "find", "#{release_path}/magento", '-type d -print0 | sudo xargs --no-run-if-empty --null --max-procs=0 chmod 770'
16
16
  execute :sudo, "find", "#{release_path}/magento", '-type f -print0 | sudo xargs --no-run-if-empty --null --max-procs=0 chmod 660'
17
17
 
18
+ # Magento bin permissions update
18
19
  if test("[ -f #{release_path}/magento/bin/magento ]")
19
20
  execute :sudo, "chmod", "+x", "#{release_path}/magento/bin/magento"
20
21
  end
22
+
23
+ # patch.log permission check
24
+ if test("[ -f #{deploy_to}/shared/magento/var/log/patch.log ]")
25
+ execute :sudo, "chmod", "0664", "#{deploy_to}/shared/magento/var/log/patch.log"
26
+ end
21
27
 
22
28
  execute :sudo, "find", "#{release_path}/magento", '-print0 | sudo xargs --no-run-if-empty --null --max-procs=0 chown', "#{fetch(:username)}:#{fetch(:group)}"
23
29
 
@@ -32,7 +38,7 @@ namespace :provision do
32
38
  on roles :app do
33
39
  info ("Checking for setup directory - #{release_path}/magento/setup")
34
40
 
35
- if test("[ -d #{release_path}/magento/setup/ ]")
41
+ if test("[ -d #{release_path}/magento/setup ]")
36
42
  else
37
43
  upload! "#{fetch(:magento_dir)}/setup", "#{release_path}/magento/", recursive: true
38
44
  invoke 'provision:permissions'
@@ -91,8 +91,8 @@ namespace :sozo do
91
91
  end
92
92
  on roles :production do
93
93
  within release_path do
94
- invoke 'magento:cache:flush'
95
94
  invoke 'magento:indexer:reindex'
95
+ invoke 'magento:cache:flush'
96
96
  end
97
97
  end
98
98
  end
@@ -26,4 +26,30 @@ namespace :wordpress do
26
26
  end
27
27
  end
28
28
 
29
+ desc "Copy Wordpress themes across"
30
+ task :copy_themes do
31
+ on roles :all do |host|
32
+ within release_path do
33
+ if fetch(:wp_copy_themes).length >= 1
34
+ # Retrieve the themes and split them into an array
35
+ themes = fetch(:wp_copy_themes).split(" ")
36
+ compiletheme = false
37
+
38
+ # Loop through and create the required theme directories
39
+ themes.each do |theme|
40
+ execute :mkdir, "-p", "#{release_path}/magento/wp/wp-content/themes/#{theme}"
41
+ execute :sudo, 'cp', '-a', "#{release_path}/environments/global/wp/wp-content/themes/#{theme}/.", "#{release_path}/magento/wp/wp-content/themes/#{theme}/"
42
+ if theme != "fishpig"
43
+ compiletheme = true
44
+ end
45
+ end
46
+
47
+ if compiletheme
48
+ invoke 'magento:fishpig:create_theme'
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+
29
55
  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.4.0
4
+ version: 1.6.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: 2021-08-03 00:00:00.000000000 Z
11
+ date: 2022-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -47,7 +47,6 @@ files:
47
47
  - lib/capistrano/tasks/composer.rake
48
48
  - lib/capistrano/tasks/db.rake
49
49
  - lib/capistrano/tasks/deploy.rake
50
- - lib/capistrano/tasks/fishpig.rake
51
50
  - lib/capistrano/tasks/magento2.rake
52
51
  - lib/capistrano/tasks/provision.rake
53
52
  - lib/capistrano/tasks/server.rake
@@ -1,16 +0,0 @@
1
- namespace :fishpig do
2
- namespace :setup do
3
- desc "Install the Wordpress Fishpig theme"
4
- task :install_theme do
5
- on roles :all do |host|
6
- within release_path do
7
- execute :mkdir, "-p", "#{release_path}/magento/wp/wp-content/themes/fishpig"
8
- end
9
- end
10
-
11
- on roles(:all) do
12
- execute :sudo, 'cp', '-a', "#{release_path}/environments/global/wp/wp-content/themes/fishpig/.", "#{release_path}/magento/wp/wp-content/themes/fishpig/"
13
- end
14
- end
15
- end
16
- end