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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/capistrano/sozo_magento2/slack.rb +1 -0
- data/lib/capistrano/sozo_magento2/version.rb +1 -1
- data/lib/capistrano/tasks/db.rake +14 -10
- data/lib/capistrano/tasks/slack.rake +4 -1
- data/lib/capistrano/tasks/sozo.rake +12 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 808960e0120a734084b78112c9497f68ed02df489515f806d9ffc0108c368ed2
|
4
|
+
data.tar.gz: dd00b79984f21952466e405443b006263e820517c2a0661cea0e4961a02991d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
@@ -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:
|
12
|
-
invoke 'db:
|
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 :
|
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 :
|
28
|
+
task :wp_db_backup do
|
29
29
|
# Backup the database with a timestamp
|
30
30
|
on roles :all do
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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 "
|
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
|
-
|
13
|
-
|
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.
|
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-
|
11
|
+
date: 2021-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|