capistrano-sozo_magento2 1.2.0 → 1.2.1

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: 57d66531993d668be8a75fef480862d07035dcf0750f7831912f71bc749d5201
4
- data.tar.gz: 5032e4073c3eed84ce9030206c0e9c3cfbdfbf29e8d12d1968802f48df3fa42b
3
+ metadata.gz: 808960e0120a734084b78112c9497f68ed02df489515f806d9ffc0108c368ed2
4
+ data.tar.gz: dd00b79984f21952466e405443b006263e820517c2a0661cea0e4961a02991d2
5
5
  SHA512:
6
- metadata.gz: 3550c64e691e692c9e896078f269ecc8ef5035b3ce4c110df0020aa47cdd6d6c5e3b1bb47b58f06ef57db16b57a96510d6ac8509713fd3ff4f299519810842f1
7
- data.tar.gz: 2e6f979c104a3c2d175894d0cc3e0ad08531abdc9bbfb8faa19cc2714c4d0e92bf18a2c2c6fa042f7a30a8228842167ea44ece6350482a4d886d2e344fedce98
6
+ metadata.gz: a95a1a495572c06f9dcda5c8e535bc4785349044b0fb5c95702fc3aa8191b1337a3f64c9e977b97a914905b2c2a54278a2cb0df1473703850b6869179999803e
7
+ data.tar.gz: 5d32ba014c057f5a3e7116d99c68dad25a2432102688de1905b19793c2920f3ab477816eacfaf19b29f8a5b6e4d01af9fc8a5b60561efcc31da658301c4b3d04
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
+ ## [v1.2.1] - 2020-05-06
25
+ ### Fixed
26
+ - WordPress backup not respecting the :wp_backup false option
27
+ - Erroneous symlink created inside release directories
28
+ - Added simple text output in Slack message
29
+
30
+
24
31
  ## [v1.2.0] - 2020-03-25
25
32
  ### Added
26
33
  - New variable `clear_failures` for future use.
@@ -10,6 +10,7 @@ module SozoMagento2
10
10
  "username" => "SOZO Deploy Bot",
11
11
  "icon_emoji" => ":satellite:",
12
12
  "color" => "good",
13
+ "text" => "#{fetch(:url)} Deployment Process Begun",
13
14
  "blocks" => [
14
15
  {
15
16
  "type" => "header",
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module SozoMagento2
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.1"
4
4
  end
5
5
  end
@@ -7,14 +7,14 @@ namespace :db do
7
7
  if test("[ ! -d #{fetch(:backupdir)} ]")
8
8
  execute :mkdir, "-p", fetch(:backupdir)
9
9
  end
10
-
11
- invoke 'db:mag_backup'
12
- invoke 'db:wp_backup' if fetch(:wp_backup)
10
+
11
+ invoke 'db:mag_db_backup'
12
+ invoke 'db:wp_db_backup'
13
13
  end
14
14
  end
15
15
 
16
16
  desc "Backup Magento database"
17
- task :mag_backup do
17
+ task :mag_db_backup do
18
18
  on roles :all do
19
19
  info "Backing up Magento database."
20
20
  execute :n98magerun, 'db:dump', "--root-dir='#{fetch(:mage_root)}'",
@@ -25,14 +25,18 @@ namespace :db do
25
25
  end
26
26
 
27
27
  desc "Backup WordPress database"
28
- task :wp_backup do
28
+ task :wp_db_backup do
29
29
  # Backup the database with a timestamp
30
30
  on roles :all do
31
- info "Backing up WordPress database."
32
- execute :n98magerun, 'db:dump', "--root-dir='#{fetch(:mage_root)}'",
33
- '--compression="gzip"',
34
- '--connection="wordpress"',
35
- '--force', "#{fetch(:backupdir)}/#{fetch(:date_path)}_wp.sql.gz"
31
+ if (fetch(:wp_backup) == "true")
32
+ info "Backing up WordPress database."
33
+ execute :n98magerun, 'db:dump', "--root-dir='#{fetch(:mage_root)}'",
34
+ '--compression="gzip"',
35
+ '--connection="wordpress"',
36
+ '--force', "#{fetch(:backupdir)}/#{fetch(:date_path)}_wp.sql.gz"
37
+ else
38
+ info "WordPress backup set to false"
39
+ end
36
40
  end
37
41
  end
38
42
 
@@ -1,5 +1,4 @@
1
1
  require 'capistrano/sozo_magento2/slack'
2
- require 'json'
3
2
 
4
3
  include SozoMagento2::Slack
5
4
 
@@ -8,6 +7,7 @@ namespace :slack do
8
7
  task :deployed do
9
8
  on roles(:all) do
10
9
  slack_template = message_hash
10
+ slack_template['text'] = "#{fetch(:url)} Deployment Process Successful"
11
11
  slack_template['blocks'][0]['text']['text'] = ":smile: Deployment Successful :smile:"
12
12
  slack_template['blocks'][2]['text']['text'] = "#{fetch(:url)} Deployed."
13
13
  execute :curl, "--request", "POST", "--header", "'Content-Type: application/json'", "--data", "'" + JSON.generate(slack_template) + "'", fetch(:slack_webhook)
@@ -18,6 +18,7 @@ namespace :slack do
18
18
  task :deploying do
19
19
  on roles(:all) do
20
20
  slack_template = message_hash
21
+ slack_template['text'] = "#{fetch(:url)} Deployment Process Begun"
21
22
  slack_template['blocks'][0]['text']['text'] = ":crossed_fingers: Deployment Process Begun :crossed_fingers:"
22
23
  slack_template['blocks'][2]['text']['text'] = "#{fetch(:url)} is being Deployed."
23
24
  execute :curl, "--request", "POST", "--header", "'Content-Type: application/json'", "--data", "'" + JSON.generate(slack_template) + "'", fetch(:slack_webhook)
@@ -28,6 +29,7 @@ namespace :slack do
28
29
  task :message do
29
30
  on roles(:all) do
30
31
  slack_template = message_hash
32
+ slack_template['text'] = "Some message here"
31
33
  slack_template['blocks'][0]['text']['text'] = "Message"
32
34
  slack_template['blocks'][2]['text']['text'] = "Some message to go here"
33
35
  execute :curl, "--request", "POST", "--header", "'Content-Type: application/json'", "--data", "'" + JSON.generate(slack_template) + "'", fetch(:slack_webhook)
@@ -38,6 +40,7 @@ namespace :slack do
38
40
  task :failed do
39
41
  on roles(:all) do
40
42
  slack_template = message_hash
43
+ slack_template['text'] = "#{fetch(:url)} Deployment Process Failed!"
41
44
  slack_template['blocks'][0]['text']['text'] = ":boom: Deployment Process Failed :boom:"
42
45
  slack_template['blocks'][2]['text']['text'] = "#{fetch(:url)} deployment has failed."
43
46
  execute :curl, "--request", "POST", "--header", "'Content-Type: application/json'", "--data", "'" + JSON.generate(slack_template) + "'", fetch(:slack_webhook)
@@ -6,11 +6,19 @@ namespace :sozo do
6
6
  releases = capture(:ls, "-x", releases_path).split
7
7
  valid, invalid = releases.partition { |e| /^\d{14}$/ =~ e }
8
8
 
9
- info "last release #{valid.last}"
10
- info "Creating symlink from #{fetch(:deploy_to)}/releases/#{valid.last} to #{fetch(:deploy_to)}/current"
9
+ info "Checking current and magento root directories are setup correctly."
11
10
 
12
- execute :ln, "-sf", "#{fetch(:deploy_to)}/releases/#{valid.last}", "#{fetch(:deploy_to)}/current"
13
- execute :ln, "-sf", "#{fetch(:deploy_to)}/releases/#{valid.last}", "#{fetch(:mage_root)}"
11
+ current = "#{fetch(:deploy_to)}/current"
12
+ if test("[ ! -e #{current} ]")
13
+ info "Current link #{current} link is broken, regenerating."
14
+ execute :ln, "-sf", "#{fetch(:deploy_to)}/releases/#{valid.last}", current
15
+ end
16
+
17
+ m2root = "#{fetch(:mage_root)}"
18
+ if test("[ ! -e #{m2root} ]")
19
+ info "M2Path link #{m2root} link is broken, regenerating."
20
+ execute :ln, "-sf", "#{fetch(:deploy_to)}/releases/#{valid.last}/magento", m2root
21
+ end
14
22
  end
15
23
  end
16
24
 
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.2.0
4
+ version: 1.2.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-03-25 00:00:00.000000000 Z
11
+ date: 2021-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano