drush-deploy 1.0.0 → 1.0.1.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/drush-deploy.gemspec +1 -1
- data/lib/drush_deploy/capistrano.rb +1 -0
- data/lib/drush_deploy/configuration.rb +35 -39
- data/lib/drush_deploy/recipes/setup.rb +1 -0
- metadata +11 -11
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.1.beta1'
|
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"]
|
@@ -36,6 +36,7 @@ module DrushDeploy
|
|
36
36
|
@cap_config.load do
|
37
37
|
# Verify existence of required setting
|
38
38
|
if this.valid_target(site)
|
39
|
+
logger.info "Loading target #{sitename}"
|
39
40
|
# Setup servername. Use <username>@ and :<port> syntax in servername instead of
|
40
41
|
# :user and ssh_option[:port] to allow for different values per host.
|
41
42
|
servername = site["remote-host"]
|
@@ -32,33 +32,25 @@ module DrushDeploy
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def load_configuration
|
35
|
-
@aliases =
|
36
|
-
|
37
|
-
|
38
|
-
conf['ssh-options'] = Net::SSH::Config.translate translate_ssh_options(conf['ssh-options'])
|
39
|
-
end
|
40
|
-
if conf['roles']
|
41
|
-
if conf['roles'].is_a? String
|
42
|
-
conf['roles'] = conf['roles'].split(/ *, */)
|
43
|
-
end
|
44
|
-
conf['roles'] = conf['roles'].map{ |r| r.strip.to_sym }
|
45
|
-
end
|
46
|
-
if conf['attributes']
|
47
|
-
# Recursively turn all hash keys into symbols
|
48
|
-
mapper = lambda do |h|
|
49
|
-
h.inject({}) {|result,(k,v)| result[k.to_sym] = (v.is_a?(Hash) ? mapper(v) : v); result }
|
50
|
-
end
|
51
|
-
conf['attributes'] = mapper.(conf['attributes'])
|
35
|
+
@aliases = PHP.unserialize(`#{@drush} eval 'print serialize(_drush_sitealias_all_list());'`).inject({}) do |h,(k,v)|
|
36
|
+
if k != '@none'
|
37
|
+
h[k.sub(/^@/,'')] = v
|
52
38
|
end
|
39
|
+
h
|
53
40
|
end
|
54
|
-
|
55
|
-
|
56
|
-
def site_aliases
|
57
|
-
PHP.unserialize(`#{@drush} eval 'print serialize(_drush_sitealias_all_list());'`).delete_if {|k,v| k == '@none'}
|
41
|
+
@normalized_aliases = {}
|
58
42
|
end
|
59
43
|
|
60
44
|
def lookup_site(sitename)
|
61
|
-
|
45
|
+
sitename = sitename.sub(/^@/,'')
|
46
|
+
site = @normalized_aliases[sitename]
|
47
|
+
unless site
|
48
|
+
site = @aliases[sitename]
|
49
|
+
if site
|
50
|
+
@normalized_aliases[sitename] = site = normalize_alias site
|
51
|
+
end
|
52
|
+
end
|
53
|
+
site
|
62
54
|
end
|
63
55
|
|
64
56
|
|
@@ -87,7 +79,11 @@ module DrushDeploy
|
|
87
79
|
when 'p'
|
88
80
|
option_hash["port"] = words.shift
|
89
81
|
when 'o'
|
90
|
-
|
82
|
+
opt = words.shift.split(/=/)
|
83
|
+
if opt && opt.size == 2
|
84
|
+
opt[0].downcase!
|
85
|
+
option_hash.store *opt;
|
86
|
+
end
|
91
87
|
end
|
92
88
|
end
|
93
89
|
else
|
@@ -97,25 +93,25 @@ module DrushDeploy
|
|
97
93
|
option_hash
|
98
94
|
end
|
99
95
|
|
100
|
-
def
|
101
|
-
|
102
|
-
|
103
|
-
|
96
|
+
def normalize_alias(conf)
|
97
|
+
conf = conf.dup
|
98
|
+
if conf['ssh-options']
|
99
|
+
conf['ssh-options'] = Net::SSH::Config.translate translate_ssh_options(conf['ssh-options'])
|
104
100
|
end
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
end
|
116
|
-
h[k]
|
101
|
+
if conf['roles']
|
102
|
+
if conf['roles'].is_a? String
|
103
|
+
conf['roles'] = conf['roles'].split(/ *, */)
|
104
|
+
end
|
105
|
+
conf['roles'] = conf['roles'].map{ |r| r.strip.to_sym }
|
106
|
+
end
|
107
|
+
if conf['attributes']
|
108
|
+
# Recursively turn all hash keys into symbols
|
109
|
+
mapper = lambda do |h|
|
110
|
+
h.inject({}) {|result,(k,v)| result[k.to_sym] = (v.is_a?(Hash) ? mapper(v) : v); result }
|
117
111
|
end
|
112
|
+
conf['attributes'] = mapper.(conf['attributes'])
|
118
113
|
end
|
114
|
+
conf
|
119
115
|
end
|
120
116
|
|
121
117
|
end
|
@@ -20,6 +20,7 @@ set :update_modules, (ENV['UPDATE_MODULES'] =~ true_values) if ENV['UPDATE_MODUL
|
|
20
20
|
set :target, ENV['TARGET'] if ENV['TARGET']
|
21
21
|
set :source, ENV['SOURCE'] if ENV['SOURCE']
|
22
22
|
|
23
|
+
set :application, 'Drupal'
|
23
24
|
set :deploy_via, :copy
|
24
25
|
set :use_sudo, false
|
25
26
|
set :drush_bin, "drush"
|
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drush-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.1.beta1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Matt Edlefsen
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
16
|
-
requirement: &
|
16
|
+
requirement: &23598360 !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: *23598360
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: railsless-deploy
|
27
|
-
requirement: &
|
27
|
+
requirement: &23597580 !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: *23597580
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: php_serialize
|
38
|
-
requirement: &
|
38
|
+
requirement: &23596880 !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: *23596880
|
47
47
|
description: Utilizes capistrano to allow for doing intellegent deployments of drupal
|
48
48
|
projects.
|
49
49
|
email: matt@xforty.com
|
@@ -88,9 +88,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
89
|
none: false
|
90
90
|
requirements:
|
91
|
-
- - ! '
|
91
|
+
- - ! '>'
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
93
|
+
version: 1.3.1
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
96
|
rubygems_version: 1.8.10
|