capistrano-drupal 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +9 -2
- data/VERSION +1 -1
- data/lib/capistrano-drupal.rb +16 -20
- metadata +3 -3
data/README.markdown
CHANGED
@@ -14,9 +14,16 @@ Open your application's `Capfile` and make it begin like this:
|
|
14
14
|
|
15
15
|
require 'rubygems'
|
16
16
|
require 'railsless-deploy'
|
17
|
-
require 'capistrano-drupal
|
17
|
+
require 'capistrano-drupal'
|
18
18
|
load 'config/deploy'
|
19
19
|
|
20
20
|
You should then be able to proceed as you would usually, you may want to familiarise yourself with the truncated list of tasks, you can get a full list with:
|
21
21
|
|
22
|
-
$ cap -T
|
22
|
+
$ cap -T
|
23
|
+
|
24
|
+
## Roadmap
|
25
|
+
|
26
|
+
- Split out the tasks into indivual files/modules
|
27
|
+
- Use drush aliases
|
28
|
+
- Support install profiles
|
29
|
+
- Support composer
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.9
|
data/lib/capistrano-drupal.rb
CHANGED
@@ -12,20 +12,17 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
12
12
|
set :deploy_via, :remote_cache
|
13
13
|
_cset :branch, "master"
|
14
14
|
set :git_enable_submodules, true
|
15
|
+
|
16
|
+
set :drush_cmd, "drush"
|
17
|
+
|
15
18
|
set :runner_group, "www-data"
|
16
19
|
set :group_writable, false
|
17
20
|
|
18
21
|
set(:deploy_to) { "/var/www/#{application}" }
|
19
22
|
set :shared_children, ['files', 'private']
|
20
|
-
|
21
|
-
after "deploy:
|
22
|
-
after "deploy
|
23
|
-
after "drupal:symlink_shared", "drush:site_offline"
|
24
|
-
after "deploy:symlink", "drupal:symlink_shared"
|
25
|
-
after "deploy:symlink", "drush:updatedb"
|
26
|
-
after "deploy:symlink", "drush:cache_clear"
|
27
|
-
after "deploy:symlink", "drush:site_online"
|
28
|
-
after "deploy:symlink", "git:push_deploy_tag"
|
23
|
+
|
24
|
+
after "deploy:update_code", "drupal:symlink_shared", "drush:site_offline", "drush:updatedb", "drush:cache_clear", "drush:site_online"
|
25
|
+
after "deploy", "git:push_deploy_tag"
|
29
26
|
|
30
27
|
namespace :deploy do
|
31
28
|
desc <<-DESC
|
@@ -42,10 +39,10 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
42
39
|
DESC
|
43
40
|
task :setup, :except => { :no_release => true } do
|
44
41
|
dirs = [deploy_to, releases_path, shared_path].join(' ')
|
45
|
-
run "#{try_sudo} mkdir -p #{
|
46
|
-
run "#{try_sudo} chown -R #{
|
42
|
+
run "#{try_sudo} mkdir -p #{releases_path} #{shared_path}"
|
43
|
+
run "#{try_sudo} chown -R #{user}:#{runner_group} #{deploy_to}"
|
47
44
|
sub_dirs = shared_children.map { |d| File.join(shared_path, d) }
|
48
|
-
run "#{try_sudo} chmod
|
45
|
+
run "#{try_sudo} chmod 2775 #{sub_dirs.join(' ')}"
|
49
46
|
end
|
50
47
|
end
|
51
48
|
|
@@ -79,30 +76,29 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
79
76
|
|
80
77
|
desc "Backup the database"
|
81
78
|
task :backupdb, :on_error => :continue do
|
82
|
-
|
83
|
-
run "drush -r #{app_path} bam-backup"
|
79
|
+
run "#{drush_cmd} -r #{app_path} bam-backup"
|
84
80
|
end
|
85
81
|
|
86
82
|
desc "Run Drupal database migrations if required"
|
87
83
|
task :updatedb, :on_error => :continue do
|
88
|
-
run "
|
84
|
+
run "#{drush_cmd} -r #{app_path} updatedb -y"
|
89
85
|
end
|
90
86
|
|
91
87
|
desc "Clear the drupal cache"
|
92
88
|
task :cache_clear, :on_error => :continue do
|
93
|
-
run "
|
89
|
+
run "#{drush_cmd} -r #{app_path} cc all"
|
94
90
|
end
|
95
91
|
|
96
92
|
desc "Set the site offline"
|
97
93
|
task :site_offline, :on_error => :continue do
|
98
|
-
run "
|
99
|
-
run "
|
94
|
+
run "#{drush_cmd} -r #{app_path} vset site_offline 1 -y"
|
95
|
+
run "#{drush_cmd} -r #{app_path} vset maintenance_mode 1 -y"
|
100
96
|
end
|
101
97
|
|
102
98
|
desc "Set the site online"
|
103
99
|
task :site_online, :on_error => :continue do
|
104
|
-
run "
|
105
|
-
run "
|
100
|
+
run "#{drush_cmd} -r #{app_path} vset site_offline 0 -y"
|
101
|
+
run "#{drush_cmd} -r #{app_path} vset maintenance_mode 0 -y"
|
106
102
|
end
|
107
103
|
|
108
104
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 9
|
9
|
+
version: 0.1.9
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kim Pepper
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-
|
17
|
+
date: 2012-09-03 00:00:00 +10:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|