capistrano-craft 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 0307770f776f3de8aa29e6903060ef0549e7bf81
4
- data.tar.gz: f4d15ac89b13f88992b32e9b0c67d4cf0262695e
3
+ metadata.gz: 249fbb6884c17a8c88689bb3766cf51d64ecd3d6
4
+ data.tar.gz: 77503ac4c7d107900c120cca8ca06f4d97feaa4a
5
5
  SHA512:
6
- metadata.gz: 5d30b65c31c6f3cabaac3711ed517b7986d4cd75db98320aee342f35670297bbdc96b327ae96f3b7587d8878e55d43950291f57ce89e7773fe4d0d23bd800ebf
7
- data.tar.gz: 2d0c5092c8f1cc8c500e34d937cbc0499885303c3549c19100f284c65cd65efd1d1716acc72dc3e27ec59816bc46e859322e59a6ab2b05b930f05f36c8adee81
6
+ metadata.gz: 52ac278d6f8e8460c6cc3c5ef5315621d10f16b4be981bd9fae1913774afc8158a1d26785357a4ccaa075e2cee7ae2540ead7bc5bfcb89f0f584deb0215b38a6
7
+ data.tar.gz: 8da018126d8717da21f1fcf9bd3d4eb670f11bc7dfbce5af5a3e63e850f8994a9299599730eafcc7c0f61d6986b8f78b1dc009c0f5e87229288f90cf075e62b0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-craft (0.1.2)
4
+ capistrano-craft (0.1.3)
5
5
  capistrano (~> 3.1)
6
6
  capistrano-composer (~> 0.0.6)
7
7
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Capistrano::Craft
2
2
 
3
- As of October 2019 this is very still very much under development. Please make sure you have appropriate backups to avoid any potential data loss.
3
+ As of November 2019 this is very still very much under development. Please make sure you have appropriate backups to avoid any potential data loss.
4
4
 
5
5
  This gem automates the deployment of Craft CMS apps with Capistrano. It will automatically detect local and remote environment settings to make synchronizing of database and assets straightforward.
6
6
 
@@ -18,8 +18,23 @@ Or install system wide:
18
18
 
19
19
  ## Usage
20
20
 
21
- $ staging deploy
22
- $ production deploy
21
+ The setting you will likely need to customize is:
22
+ ```
23
+ # This should be your command to compile assets for production
24
+ set :craft_compile_assets, "npm run production --production --silent"
25
+ ```
26
+
27
+ If you are using PHP-FPM it is necessary to restart it after deployment. Currently capistrano-craft doesn't handle this for you and you may need to add something along the lines of the following to your `deploy.rb` file.
28
+
29
+ ```
30
+ before 'deploy:published', 'fpm_restart'
31
+
32
+ task :fpm_restart do
33
+ on release_roles :all do |host|
34
+ execute "sudo service php7.3-fpm restart"
35
+ end
36
+ end
37
+ ```
23
38
 
24
39
  ### Compiling Assets
25
40
 
@@ -28,11 +43,13 @@ Change `:craft_compile_assets` to be your production asset compilation command.
28
43
  ### Synchronize Database
29
44
 
30
45
 
46
+ ### Upgrading Craft CMS
31
47
 
32
- ### Settings
33
-
48
+ When you deploy, Capistrano will run composer automatically installing your chosen packages. If you have upgraded Craft locally, the new version will automatically be installed on your deployment.
34
49
 
50
+ If you were to upgrade on the server, then run `cap production craft:pull` to sync the database and assets down, the database would be running a newer version than your local codebase. This should be easily resolved by updating through Composer or the Craft admin area (assuming Craft runs correctly with the conflict).
35
51
 
52
+ ### Settings
36
53
 
37
54
  Full list of available settings:
38
55
 
@@ -17,7 +17,7 @@ set :craft_local_backups, "backups"
17
17
  set :craft_remote_backups, "shared/backups"
18
18
 
19
19
  # assets
20
- set :craft_compile_assets, "production --quiet"
20
+ set :craft_compile_assets, "production"
21
21
 
22
22
  # console
23
23
  set :craft_console_path, -> { "craft" }
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Craft
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -17,10 +17,11 @@ namespace :craft do
17
17
  end
18
18
 
19
19
  namespace :cache do
20
- desc "Run the cache/flush Craft command"
21
- task :flush do
20
+ desc "Run the clear-caches/all Craft command"
21
+ task :clear do
22
22
  on release_roles(fetch(:craft_deploy_roles)) do
23
- craft_console "cache/flush"
23
+ craft_console "cache/flush-all"
24
+ craft_console "clear-caches/all"
24
25
  end
25
26
  end
26
27
  end
@@ -35,6 +36,13 @@ namespace :craft do
35
36
  end
36
37
  end
37
38
  end
39
+
40
+ desc "Re-indexes assets across all volumes"
41
+ task :reindex do
42
+ on release_roles(fetch(:craft_deploy_roles)) do
43
+ craft_console "index-assets/all"
44
+ end
45
+ end
38
46
  end
39
47
 
40
48
  desc "Pull database and sync assets"
@@ -46,7 +54,8 @@ namespace :craft do
46
54
  desc "Push database and sync assets"
47
55
  task :push do
48
56
  invoke "db:push"
49
- invoke "craft:assets:sync"
57
+ invoke "craft:assets:sync"
58
+ invoke "craft:assets:reindex"
50
59
  end
51
60
 
52
61
  end
@@ -19,15 +19,16 @@ namespace :db do
19
19
  task :backup do
20
20
  on release_roles(fetch(:craft_deploy_roles)) do
21
21
  # Export remote dump file
22
- backup_file = "#{fetch(:deploy_to)}/shared/db.sql"
23
- database_dump(fetch(:craft_remote_env), backup_file)
22
+ remote_backup_file = "#{fetch(:deploy_to)}/shared/db.sql"
23
+ database_dump(fetch(:craft_remote_env), remote_backup_file)
24
24
 
25
- download! backup_file, backup_file_name
25
+ local_backup_file = backup_file_name
26
+ download! remote_backup_file, local_backup_file
26
27
 
27
28
  # Remove temp file
28
29
  execute "rm #{backup_file}"
29
30
 
30
- set :backup_filename, backup_file_name
31
+ set :backup_filename, local_backup_file
31
32
  end
32
33
  end
33
34
 
@@ -7,12 +7,12 @@ namespace :deploy do
7
7
  task :compile_assets do
8
8
  on release_roles(fetch(:craft_deploy_roles)) do
9
9
  within release_path do
10
- execute :npm, "install", "--silent"
11
- execute :npm, "run", fetch(:craft_compile_assets)
10
+ execute :yarn, "install"
11
+ execute :yarn, "run", fetch(:craft_compile_assets)
12
12
  end
13
13
  end
14
14
  end
15
15
 
16
16
  after 'deploy:updated', 'deploy:compile_assets'
17
- after 'deploy:finished', 'craft:cache:flush'
17
+ after 'deploy:finished', 'craft:cache:clear'
18
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-craft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Dyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-16 00:00:00.000000000 Z
11
+ date: 2019-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano