capistrano-sozo_magento2 1.0.1 → 1.1.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: a9b8a814cab188b12f4a0655ca98bc2d79bba093feec15cef58e6615a4e1b163
4
- data.tar.gz: b20a3134e0ed2e7830fad511af9437778b5d49cf76cd379f228b8bf54fa4d31e
3
+ metadata.gz: 067f69be7940139b39853f161c2cdccfaf59bc3efe7c889a3c4282b7a6c91191
4
+ data.tar.gz: b235fcf83c747dcdb843e64bdddd44df30366bdc84a363a90e0425571b8a04f4
5
5
  SHA512:
6
- metadata.gz: f5217263ed2b39368320994816f8100e0a0a61ff5880997c3b53744f8f21be1b5b7315ffea492568e34acbbf17c6260556fd5b8bd17a23d99c1cac2e24b6109a
7
- data.tar.gz: 7d5846414673c6bb0174ac80fa8a7b45b1ebabd4e6cee4f058ffef7d7fbf3cb0f380b724ac4eea468f25c495da7347e2d8bbe46bb424e7760eeac85675caa70e
6
+ metadata.gz: 4015c5c7f9cf4be49d35cda7732803d4e7bd240c7d4b5f85470c8a05587c452fcb48452509561b9d55ef3fa0330ce41582c63f965e427addc5590001c64f9360
7
+ data.tar.gz: 60fc48f2e8a1b5437749978e887eec9d7ff28601a27742199826ba9a60101931ace0b6bed9ed44d91858561b79c6bd90c1fe52eb7e0989efbcc47668ae984f35
data/BUILD.md ADDED
@@ -0,0 +1,19 @@
1
+ # Build Instructions
2
+
3
+ To build the gem simply update the version number in `lib/capistrano/sozo_magento2/version.rb`.
4
+ Then you'll need to commit to vcs as the build process uses the git ls command to grab the files.
5
+ Following the commit, run the following:
6
+ ```
7
+ gem build capistrano-sozo_magento.gemspec
8
+ ```
9
+ The gem file generated will include the version number. To stop the file from being commited to the git repository move it into the pkg folder which is git ignored.
10
+
11
+ To test locally you can run the following to install the gem locally:
12
+ ```
13
+ gem install capistrano-sozo_magento2
14
+ ```
15
+
16
+ To push the gem to ruby-gems.org run the following:
17
+ ```
18
+ gem push capistrano-sozo_magento2-{version}.gem
19
+ ```
data/CHANGELOG.md CHANGED
@@ -19,9 +19,25 @@ Given a version number MAJOR.MINOR.PATCH, increment the:
19
19
  * [Fixed] for any bug fixes.
20
20
  * [Security] in case of vulnerabilities.
21
21
 
22
- ### [Unreleased]
22
+ ## [Unreleased]
23
23
 
24
- ### [v1.0.1] - 2020-02-20
24
+ ## [v1.1.0] - 2020-02-24
25
+ ### Added
26
+ - Added defaults for the :wp_backup, :keep_backups and :slack_channel instead of using ENV's
27
+ - Added BUILD.md for reminders on how to build and publish the gem.
28
+
29
+ ### Changed
30
+ - Magento and WordPress backup's now in their own commands and invoked from the main call.
31
+ - Staging role now doesn't install composer dev requirements.
32
+
33
+ ### Removed
34
+ - ENV references cleaned out and updated in the Companion Composer plugin.
35
+
36
+ ### Fixed
37
+ - Confirm command now using correct symbols to display against roles.
38
+
39
+
40
+ ## [v1.0.1] - 2020-02-20
25
41
  ### Added
26
42
  - CHANGELOG.md
27
43
  - License text
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.0"
10
+ gem "capistrano-sozo_magento2", "~> 1.1"
11
11
  ```
12
12
  2. Install
13
13
  ```
@@ -35,15 +35,42 @@ require "capistrano/scm/git"
35
35
  install_plugin Capistrano::SCM::Git
36
36
  ```
37
37
 
38
+ ### Built Ins
39
+ We have the following built ins setup for default projects.
40
+ ```
41
+ set :linked_files, []
42
+
43
+ set :linked_dirs, [
44
+ 'magento/pub/media',
45
+ 'magento/pub/sitemap',
46
+ 'magento/var/amasty/geoip',
47
+ 'magento/var/backups',
48
+ 'magento/var/composer_home',
49
+ 'magento/var/importexport',
50
+ 'magento/var/import_history',
51
+ 'magento/var/export',
52
+ 'magento/var/log',
53
+ 'magento/var/nginx',
54
+ 'magento/var/report',
55
+ 'magento/var/session',
56
+ 'magento/var/tmp',
57
+ 'magento/wp/wp-content/uploads'
58
+ ]
59
+ ```
60
+ If you would like to customize the linked files or directories for your project, you can copy either one or both of the above arrays into the `deployment/deploy.rb` or `deployment/deploy/*.rb` files and tweak them to fit your project's needs. Alternatively, you can add a single linked dir (or file) using `append` like this:
61
+ ```
62
+ append :linked_dirs, 'path/to/link'
63
+ ```
64
+
38
65
  ## Versioning
39
- We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/sozodesign/capistrano-sozo-magento2/tags) or [CHANGELOG.md](./CHANGELOG.md).
66
+ We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/sozo-design/capistrano-sozo-magento2/tags) or [CHANGELOG.md](./CHANGELOG.md).
40
67
 
41
68
 
42
69
  ## Authors
43
70
  * **Clive Walkden** - *Initial work* - [SOZO Design Ltd](https://github.com/sozo-design)
44
71
 
45
- See also the list of [contributors](https://github.com/sozodesign/capistrano-sozo-magento2/contributors) who participated in this project.
72
+ See also the list of [contributors](https://github.com/sozo-design/capistrano-sozo-magento2/contributors) who participated in this project.
46
73
 
47
74
 
48
75
  ## License
49
- This project is licensed under the Proprietary License - see the [LICENSE](LICENSE) file for details
76
+ This project is licensed under the Proprietary License - see the [LICENSE](./LICENSE) file for details
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["clive@sozodesign.co.uk"]
11
11
  spec.description = %q{Magento 2 support for Capistrano 3.x in SOZO hosted environments}
12
12
  spec.summary = %q{Magento 2 support for Capistrano 3.x in SOZO hosted environments}
13
- spec.homepage = "https://github.com/sozodesign/capistrano-sozo-magento2"
13
+ spec.homepage = "https://github.com/sozo-design/capistrano-sozo-magento2"
14
14
  spec.license = "Proprietary"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(build|test|spec|features)/}) }
@@ -44,7 +44,8 @@ after 'deploy:finished', "slack:deployed"
44
44
  after 'slack:deployed', "db:cleanup"
45
45
 
46
46
  after 'deploy:failed', "slack:failed"
47
- after 'slack:failed', 'magento:maintenance:disable'
47
+ after 'slack:failed', "sozo:fix_current"
48
+ after 'sozo:fix_current', 'magento:maintenance:disable'
48
49
 
49
50
  namespace :load do
50
51
  task :defaults do
@@ -27,13 +27,12 @@ set :composer_require_dev_flags, '--optimize-autoloader --prefer-dist'
27
27
  set :date_path, Time.now.strftime("%Y%m%d%H%M%S")
28
28
  set :backupdir, ->{ "#{fetch(:deploy_root)}/backups" }
29
29
  set :backupdirdate, ->{ "#{fetch(:backupdir)}/#{fetch(:date_path)}" }
30
- set :wp_db, ->{ ENV['WPDB_DATABASE'] }
31
- set :wp_backup, ->{ ENV['WPDB_BACKUP'] }
32
- set :keep_backups, ->{ ENV['CAP_KEEP_BACKUPS'] }
30
+ set :wp_backup, fetch(:wp_backup, true)
31
+ set :keep_backups, fetch(:keep_backups, 10)
33
32
 
34
33
  # Slack defaults
35
- set :slack_channel, ENV['SLACK_CHANNEL']
34
+ set :slack_channel, fetch(:slack_channel, '#deployments')
36
35
  set :slack_webhook, 'https://hooks.slack.com/services/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'
37
36
 
38
37
  # Deployment defaults
39
- set :confirm_deploy, fetch(:magento_deploy_confirm, [])
38
+ set :magento_deploy_confirm_roles, fetch(:magento_deploy_confirm_roles, [])
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module SozoMagento2
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -1,13 +1,13 @@
1
1
  namespace :composer do
2
2
  desc "Install the Composer dependencies"
3
3
  task :install do
4
- on roles :testing, :staging do
4
+ on roles(:all, filter: :composer_dev) do
5
5
  within release_path + 'magento/' do
6
6
  execute :composer, "install", fetch(:composer_dev_flags)
7
7
  end
8
8
  end
9
9
 
10
- on roles(:production) do
10
+ on roles(:all, exclude: :composer_dev) do
11
11
  within release_path + 'magento/' do
12
12
  execute :composer, "install", fetch(:composer_flags)
13
13
  end
@@ -16,13 +16,13 @@ namespace :composer do
16
16
 
17
17
  desc "Update the Composer dependencies"
18
18
  task :update do
19
- on roles :testing, :staging do
19
+ on roles(:all, filter: :composer_dev) do
20
20
  within release_path + 'magento/' do
21
21
  execute :composer, "update", fetch(:composer_dev_flags)
22
22
  end
23
23
  end
24
24
 
25
- on roles(:production) do
25
+ on roles(:all, exclude: :composer_dev) do
26
26
  within release_path + 'magento/' do
27
27
  execute :composer, "update", fetch(:composer_flags)
28
28
  end
@@ -8,20 +8,31 @@ namespace :db do
8
8
  execute :mkdir, "-p", fetch(:backupdir)
9
9
  end
10
10
 
11
- # Backup using n98-magerun but don't include the logs or sessions data
11
+ invoke 'db:mag_backup'
12
+ invoke 'db:wp_backup' if fetch(:wp_backup)
13
+ end
14
+ end
15
+
16
+ desc "Backup Magento database"
17
+ task :mag_backup do
18
+ on roles :all do
12
19
  info "Backing up Magento database."
13
20
  execute :n98magerun, 'db:dump', "--root-dir='#{fetch(:mage_root)}'",
14
21
  '--compression="gzip"',
15
22
  '--strip="@log @sessions"',
16
23
  '--force', "#{fetch(:backupdir)}/#{fetch(:date_path)}_m2.sql.gz"
24
+ end
25
+ end
17
26
 
18
- if ENV['WPDB_BACKUP'] == "true"
19
- info "Backing up WordPress database."
20
- execute :n98magerun, 'db:dump', "--root-dir='#{fetch(:mage_root)}'",
21
- '--compression="gzip"',
22
- '--connection="wordpress"',
23
- '--force', "#{fetch(:backupdir)}/#{fetch(:date_path)}_wp.sql.gz"
24
- end
27
+ desc "Backup WordPress database"
28
+ task :wp_backup do
29
+ # Backup the database with a timestamp
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"
25
36
  end
26
37
  end
27
38
 
@@ -1,6 +1,6 @@
1
1
  namespace :deploy do
2
2
  before :starting, :confirm_action do
3
- if fetch(:magento_deploy_confirm).include? fetch(:stage).to_s
3
+ if fetch(:magento_deploy_confirm_roles).include? fetch(:stage).to_s
4
4
  print "\e[0;31m Are you sure you want to deploy to #{fetch(:stage).to_s}? [y/n] \e[0m"
5
5
  proceed = STDIN.gets[0..0] rescue nil
6
6
  exit unless proceed == 'y' || proceed == 'Y'
@@ -78,6 +78,8 @@ namespace :sozo do
78
78
  execute :cp, "#{release_path}/environments/#{fetch(:environment)}/.htpasswd", "#{release_path}/magento/.htpasswd"
79
79
  end
80
80
  end
81
+
82
+ invoke! "sozo:fix_current"
81
83
  end
82
84
 
83
85
  desc "Git Check"
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.0.1
4
+ version: 1.1.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-02-20 00:00:00.000000000 Z
11
+ date: 2021-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -46,6 +46,7 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - ".gitignore"
49
+ - BUILD.md
49
50
  - CHANGELOG.md
50
51
  - Gemfile
51
52
  - LICENSE
@@ -65,7 +66,7 @@ files:
65
66
  - lib/capistrano/tasks/sozo.rake
66
67
  - lib/capistrano/tasks/sozo_magento2.rake
67
68
  - lib/capistrano/tasks/wordpress.rake
68
- homepage: https://github.com/sozodesign/capistrano-sozo-magento2
69
+ homepage: https://github.com/sozo-design/capistrano-sozo-magento2
69
70
  licenses:
70
71
  - Proprietary
71
72
  metadata: {}