capistrano-magento2 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14813882851519f0585e260ccab51fc9ae4e1f40
4
- data.tar.gz: 41b34bfd696df87fc7c6cea190d7ea14185d8659
3
+ metadata.gz: 9d5976d0843bf4508e972203a4e29e52da50bb51
4
+ data.tar.gz: 82ee5fdf18cdc176152dfad7134eba597f8f192d
5
5
  SHA512:
6
- metadata.gz: 4d6b8420a7a06bdb2a8b6488467c58b122c77174d95cb71308662b1c57a6f97c2e0ceb71f40973f83313b6f5b5c0bb296b35fb8005e7ec59f6537764aeb326ce
7
- data.tar.gz: 2317f56904fd1de989e3ab050e2848f91e21800dfdd148a78bae21a57bdb785392613b6fb622faab8cadddbfd6053d23efd48aefc1f6903d5d3609a77378ac89
6
+ metadata.gz: 0a7e173fb212aa6fd79cef37281fd2abeb7f83e3bfb6448a3cc009f2f937c58fe64817e94ed2a12ade528b15765be0f69173acf38e664573e9febc1d8bfb2cac
7
+ data.tar.gz: 8de39dba7eaea8013995e3346b065aeab1272d2a230df24381ae61cfe368b275e2e32d67eb7f1f4babc212471cae78d39408bc46ac766dd3405cd8e51d090a38
@@ -1,5 +1,11 @@
1
1
  # Capistrano::Magento2 Change Log
2
2
 
3
+ ==========
4
+ 0.7.2
5
+
6
+ * Added support for Magento 2.2 [static content deploy strategies](http://bit.ly/2yhMvVv) (PR #85)
7
+ * Added support for Magento 2.2 [shared application config files](http://bit.ly/2gF8Ouu)
8
+
3
9
  0.7.1
4
10
  ==========
5
11
 
data/README.md CHANGED
@@ -132,6 +132,7 @@ Before you can use Capistrano to deploy, you must configure the `config/deploy.r
132
132
  | `:magento_deploy_chmod_d` | `2770` | Default permissions applied to all directories in the release path
133
133
  | `:magento_deploy_chmod_f` | `0660` | Default permissions applied to all non-executable files in the release path
134
134
  | `:magento_deploy_chmod_x` | `['bin/magento']` | Default list of files in release path to set executable bit on
135
+ | `:magento_deploy_strategy` | `nil` | Can be `quick`, `standard` or `compact`; supported by Magento 2.2 or later
135
136
 
136
137
  #### Example Usage
137
138
 
@@ -51,6 +51,7 @@ set :magento_deploy_maintenance, fetch(:magento_deploy_maintenance, true)
51
51
  set :magento_deploy_production, fetch(:magento_deploy_production, true)
52
52
  set :magento_deploy_themes, fetch(:magento_deploy_themes, [])
53
53
  set :magento_deploy_jobs, fetch(:magento_deploy_jobs, nil) # this defaults to 4 when supported by bin/magento
54
+ set :magento_deploy_strategy, fetch(:magento_deploy_strategy, nil) # Magento 2.2 or later only: http://bit.ly/2yhMvVv
54
55
 
55
56
  # deploy targetting defaults
56
57
  set :magento_deploy_setup_role, fetch(:magento_deploy_setup_role, :all)
@@ -9,6 +9,6 @@
9
9
 
10
10
  module Capistrano
11
11
  module Magento2
12
- VERSION = '0.7.1'
12
+ VERSION = '0.7.2'
13
13
  end
14
14
  end
@@ -44,6 +44,15 @@ namespace :deploy do
44
44
 
45
45
  invoke 'magento:setup:db:schema:upgrade'
46
46
  invoke 'magento:setup:db:data:upgrade'
47
+
48
+ # The app:config:import command was introduced in 2.2.0; check if it exists before invoking it
49
+ on primary fetch(:magento_deploy_setup_role) do
50
+ within release_path do
51
+ if test :magento, 'app:config:import --help >/dev/null 2>&1'
52
+ invoke 'magento:app:config:import'
53
+ end
54
+ end
55
+ end
47
56
 
48
57
  on primary fetch(:magento_deploy_setup_role) do
49
58
  within release_path do
@@ -12,6 +12,28 @@ include Capistrano::Magento2::Setup
12
12
 
13
13
  namespace :magento do
14
14
 
15
+ namespace :app do
16
+ namespace :config do
17
+ desc 'Create dump of application config'
18
+ task :dump do
19
+ on primary fetch(:magento_deploy_setup_role) do
20
+ within release_path do
21
+ execute :magento, 'app:config:dump'
22
+ end
23
+ end
24
+ end
25
+
26
+ desc 'Import data from shared config files'
27
+ task :import do
28
+ on primary fetch(:magento_deploy_setup_role) do
29
+ within release_path do
30
+ execute :magento, 'app:config:import'
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+
15
37
  namespace :cache do
16
38
  desc 'Flush Magento cache storage'
17
39
  task :flush do
@@ -311,13 +333,22 @@ namespace :magento do
311
333
  deploy_languages = [fetch(:magento_deploy_languages).join(' ')]
312
334
  end
313
335
 
336
+ # Magento 2.2 introduced static content compilation strategies that can be one of the following:
337
+ # quick (default), standard (like previous versions) or compact
338
+ compilation_strategy = fetch(:magento_deploy_strategy)
339
+ if compilation_strategy and _magento_version >= Gem::Version.new('2.2.0')
340
+ compilation_strategy = "-s #{compilation_strategy} "
341
+ else
342
+ compilation_strategy = nil
343
+ end
344
+
314
345
  within release_path do
315
346
  # Magento 2.1 will fail to deploy if this file does not exist and static asset signing is enabled
316
347
  execute "touch #{release_path}/pub/static/deployed_version.txt"
317
348
 
318
349
  # This loop exists to support deploy on versions where each language must be deployed seperately
319
350
  deploy_languages.each do |lang|
320
- static_content_deploy "#{deploy_jobs}#{lang}#{deploy_themes}"
351
+ static_content_deploy "#{compilation_strategy}#{deploy_jobs}#{lang}#{deploy_themes}"
321
352
  end
322
353
  end
323
354
 
@@ -330,7 +361,7 @@ namespace :magento do
330
361
  within release_path do with(https: 'on') {
331
362
  # This loop exists to support deploy on versions where each language must be deployed seperately
332
363
  deploy_languages.each do |lang|
333
- static_content_deploy "#{deploy_jobs}#{lang}#{deploy_themes}#{deploy_flags}"
364
+ static_content_deploy "#{compilation_strategy}#{deploy_jobs}#{lang}#{deploy_themes}#{deploy_flags}"
334
365
  end
335
366
  } end
336
367
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-magento2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Alger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-30 00:00:00.000000000 Z
11
+ date: 2017-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano