drush-deploy 1.0.5 → 1.0.6
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.
data/README.md
CHANGED
data/drush-deploy.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'drush-deploy'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.6'
|
4
4
|
s.summary = "Deployment strategy for Drupal using Drush"
|
5
5
|
s.description = "Utilizes capistrano to allow for doing intellegent deployments of drupal projects."
|
6
6
|
s.authors = ["Matt Edlefsen"]
|
@@ -11,15 +11,9 @@ module DrushDeploy
|
|
11
11
|
|
12
12
|
DEFAULT_ROLES = [:web]
|
13
13
|
|
14
|
-
def initialize
|
15
|
-
@cap_config =
|
16
|
-
|
17
|
-
if @cap_config.exists? :drush
|
18
|
-
@drush_config = DrushDeploy::Configuration.new @cap_config[:drush]
|
19
|
-
else
|
20
|
-
@drush_config = DrushDeploy::Configuration.new
|
21
|
-
@cap_config.set :drush, @drush_config.drush
|
22
|
-
end
|
14
|
+
def initialize(config)
|
15
|
+
@cap_config = config
|
16
|
+
@drush_config = DrushDeploy::Configuration.new @cap_config[:drush]
|
23
17
|
@cap_config.logger.info "Using drush at \"#{@drush_config.drush}\""
|
24
18
|
end
|
25
19
|
|
@@ -84,7 +84,7 @@ module DrushDeploy
|
|
84
84
|
|
85
85
|
tmp = capture('mktemp').strip
|
86
86
|
put script, tmp, :once => true
|
87
|
-
resp = capture "#{
|
87
|
+
resp = capture "#{remote_drush} php-script '#{tmp}' && rm -f '#{tmp}'"
|
88
88
|
|
89
89
|
settings = {}
|
90
90
|
unless resp.empty?
|
@@ -148,12 +148,12 @@ module DrushDeploy
|
|
148
148
|
__END__
|
149
149
|
END
|
150
150
|
|
151
|
-
run %Q{TMP=`mktemp` && sed -n '/^__END__$/ q; p' > $TMP && cd '#{latest_release}' && #{
|
151
|
+
run %Q{TMP=`mktemp` && sed -n '/^__END__$/ q; p' > $TMP && cd '#{latest_release}' && #{remote_drush} php-script $TMP && rm -f "$TMP"},
|
152
152
|
:data => script
|
153
153
|
end
|
154
154
|
|
155
155
|
def updatedb
|
156
|
-
run "cd '#{latest_release}' && #{
|
156
|
+
run "cd '#{latest_release}' && #{remote_drush} updatedb --yes", :once => true
|
157
157
|
end
|
158
158
|
|
159
159
|
def config(*args)
|
@@ -176,7 +176,7 @@ module DrushDeploy
|
|
176
176
|
url = options[:config] ? DrushDeploy::Database.url(options[:config]) : nil
|
177
177
|
tmp = capture('mktemp').strip
|
178
178
|
put(sql,tmp)
|
179
|
-
cmd = %Q{cd '#{latest_release}' && #{
|
179
|
+
cmd = %Q{cd '#{latest_release}' && #{remote_drush} sql-cli #{url ? "--db-url='#{url}'" : ''} < '#{tmp}' && rm -f '#{tmp}'}
|
180
180
|
if options[:capture]
|
181
181
|
capture(cmd)
|
182
182
|
else
|
@@ -17,12 +17,12 @@ namespace :deploy do
|
|
17
17
|
namespace :web do
|
18
18
|
desc "Disable the application and show a message screen"
|
19
19
|
task :disable, :roles => :web do
|
20
|
-
run "#{
|
20
|
+
run "#{remote_drush} -r #{latest_release} vset --yes site_offline 1"
|
21
21
|
end
|
22
22
|
|
23
23
|
desc "Enable the application and remove the message screen"
|
24
24
|
task :enable, :roles => :web do
|
25
|
-
run "#{
|
25
|
+
run "#{remote_drush} -r #{latest_release} vdel --yes site_offline"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'drush_deploy/database'
|
2
2
|
|
3
|
+
on :start, "drupal:load_targets"
|
3
4
|
before "deploy", "drupal:setup_build"
|
4
5
|
before "deploy:symlink", "drupal:symlink"
|
5
6
|
before "deploy:setup", "drupal:setup"
|
@@ -21,7 +22,7 @@ namespace :drupal do
|
|
21
22
|
desc "Clear all Drupal cache"
|
22
23
|
task :clearcache, :roles => :web do
|
23
24
|
unless drupal_db.db_empty?
|
24
|
-
run "#{
|
25
|
+
run "#{remote_drush} -r #{latest_release} cache-clear all"
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
@@ -53,7 +54,7 @@ namespace :drupal do
|
|
53
54
|
dbconf = databases[:default][:default]
|
54
55
|
db_url = DrushDeploy::Database.url(dbconf)
|
55
56
|
|
56
|
-
run "cd '#{latest_release}' && #{
|
57
|
+
run "cd '#{latest_release}' && #{remote_drush} site-install --yes --db-url='#{db_url}'"\
|
57
58
|
" --account-mail='#{admin_email}' --account-name='#{admin_user}' --account-pass='#{admin_password}'"\
|
58
59
|
" --site-name='#{site_name}' --site-mail='#{site_email}' "\
|
59
60
|
"#{dbconf[:admin_username] ? "--db-su='#{dbconf[:admin_username]}'" : ''} #{dbconf[:admin_password] ? "--db-su-pw='#{dbconf[:admin_password]}'" : ''}"\
|
@@ -61,7 +62,7 @@ namespace :drupal do
|
|
61
62
|
end
|
62
63
|
|
63
64
|
task :setup_build, :roles => :web do
|
64
|
-
build_cmd = "drush make #{make_args} '#{makefile}' ."
|
65
|
+
build_cmd = "#{drush} make #{make_args} '#{makefile}' ."
|
65
66
|
|
66
67
|
if make == :auto
|
67
68
|
build_cmd = "[ -f index.php ] || { [ -f '#{makefile}' ] && #{build_cmd}; }"
|
@@ -87,4 +88,9 @@ namespace :drupal do
|
|
87
88
|
end
|
88
89
|
end
|
89
90
|
|
91
|
+
task :load_targets do
|
92
|
+
if exists? :target
|
93
|
+
target.split(/ *, */).each {|t| drush_cap.load_target t }
|
94
|
+
end
|
95
|
+
end
|
90
96
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'drush_deploy/capistrano'
|
2
|
+
require 'drush_deploy/database'
|
2
3
|
|
3
4
|
true_values = /^(1|y(es)?|t(rue)?)$/i
|
4
5
|
|
@@ -26,7 +27,8 @@ set :source, ENV['SOURCE'] if ENV['SOURCE']
|
|
26
27
|
set :application, 'Drupal'
|
27
28
|
set :deploy_via, :copy
|
28
29
|
set :use_sudo, false
|
29
|
-
set :
|
30
|
+
set :drush, "drush"
|
31
|
+
set :remote_drush, "drush"
|
30
32
|
|
31
33
|
set(:databases_path) { [ "#{deploy_to}/database.php", "#{deploy_to}/database.yml",
|
32
34
|
'~/.drush/database.php', '~/.drush/database.yml',
|
@@ -38,9 +40,5 @@ set :database_ports, { :pgsql => 5432, :mysql => 3306 }
|
|
38
40
|
set :configured, false
|
39
41
|
|
40
42
|
|
41
|
-
set
|
42
|
-
set
|
43
|
-
|
44
|
-
if exists? :target
|
45
|
-
target.split(/ *, */).each {|t| drush_cap.load_target t }
|
46
|
-
end
|
43
|
+
set(:drush_cap) { DrushDeploy::Capistrano.new(self)}
|
44
|
+
set(:drupal_db) { DrushDeploy::Database.new(self)}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drush-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-05-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
16
|
-
requirement: &
|
16
|
+
requirement: &24240040 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '2.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *24240040
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: railsless-deploy
|
27
|
-
requirement: &
|
27
|
+
requirement: &24239500 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.2
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *24239500
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: php_serialize
|
38
|
-
requirement: &
|
38
|
+
requirement: &24239000 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '1.2'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *24239000
|
47
47
|
description: Utilizes capistrano to allow for doing intellegent deployments of drupal
|
48
48
|
projects.
|
49
49
|
email: matt@xforty.com
|