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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +22 -5
- data/lib/capistrano/craft/defaults.rb +1 -1
- data/lib/capistrano/craft/version.rb +1 -1
- data/lib/capistrano/tasks/craft.rake +13 -4
- data/lib/capistrano/tasks/db.rake +5 -4
- data/lib/capistrano/tasks/deploy.rake +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 249fbb6884c17a8c88689bb3766cf51d64ecd3d6
|
4
|
+
data.tar.gz: 77503ac4c7d107900c120cca8ca06f4d97feaa4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52ac278d6f8e8460c6cc3c5ef5315621d10f16b4be981bd9fae1913774afc8158a1d26785357a4ccaa075e2cee7ae2540ead7bc5bfcb89f0f584deb0215b38a6
|
7
|
+
data.tar.gz: 8da018126d8717da21f1fcf9bd3d4eb670f11bc7dfbce5af5a3e63e850f8994a9299599730eafcc7c0f61d6986b8f78b1dc009c0f5e87229288f90cf075e62b0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Capistrano::Craft
|
2
2
|
|
3
|
-
As of
|
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
|
-
|
22
|
-
|
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
|
-
|
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,10 +17,11 @@ namespace :craft do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
namespace :cache do
|
20
|
-
desc "Run the
|
21
|
-
task :
|
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
|
-
|
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
|
-
|
23
|
-
database_dump(fetch(:craft_remote_env),
|
22
|
+
remote_backup_file = "#{fetch(:deploy_to)}/shared/db.sql"
|
23
|
+
database_dump(fetch(:craft_remote_env), remote_backup_file)
|
24
24
|
|
25
|
-
|
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,
|
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 :
|
11
|
-
execute :
|
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:
|
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.
|
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-
|
11
|
+
date: 2019-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|