capistrano-rack 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/capistrano/rack.rb +15 -12
- data/lib/capistrano/rack/config.rb +4 -4
- data/lib/capistrano/rack/version.rb +1 -1
- metadata +45 -27
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
M2MxNTRjZGI1MzY1MmE5MzUwZjc3NzQ3Y2NkZDU2OTBjNDJkNzM2Yw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fe029671980131ef5ddb90eaddedb9495e1a850c
|
4
|
+
data.tar.gz: a6c69fb7f20a9325be28b36135c26259306d3eb1
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZDVkYjRiNTljMDE5N2I3NDQ3MWJhNjI5NzJmYmRhZTk3NmVlNWEwMzFkMzE0
|
11
|
-
MzNmZTkwMDY5YTEzNjAxZWM5ODIyNmFkMmM2MDZiMDdjYmM1Zjk=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NzBhNmI0NGExMjgwN2Q5MjZmMWViOGViZDFkN2RiYTA2MDJjODM5MDVmZGZj
|
14
|
-
NjEwN2ExM2M2MmUxZjMxYjRjMDEyMTg3MGJmZTI3ZjFkYzhkMDZhY2EyYjc0
|
15
|
-
OGUxOTE0OGFkZjJiMjY1MGVlNGRkMDZiYzcwM2ExMWM1NWRmYWQ=
|
6
|
+
metadata.gz: a1b94d1ef6b61d2c3cf7e1657b52c7778e0911bb300a57c83d1f5eef17026a180f79b29ff1a83d6ce76d2524b89fb4944a4c6a882afe0a48303b39f6f8b8035c
|
7
|
+
data.tar.gz: b615ea9caf4b9fbc9cbab212b1a4aa37f9a6017382bf730e3fc8685e865d200d31893da76633680de1e5cc3f9a377ecca73653ab8f21505c4447569d27f93ae4
|
data/lib/capistrano/rack.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
require 'fog'
|
3
|
-
require 'capistrano'
|
3
|
+
require 'capistrano/all'
|
4
4
|
require 'capistrano/rack/config'
|
5
5
|
require 'capistrano/rack/version'
|
6
6
|
require 'capistrano/rack/deprecated'
|
@@ -8,19 +8,23 @@ require 'capistrano/rack/deprecated'
|
|
8
8
|
module Capistrano
|
9
9
|
module Rack
|
10
10
|
extend Deprecated
|
11
|
+
include Capistrano::DSL::Env
|
11
12
|
|
12
13
|
def rack_servers(roles=nil, regex_str='')
|
14
|
+
connection_options ||= fetch(:rack_connection_options) || {}
|
15
|
+
addr_type ||= fetch(:rack_addr_type) || :private
|
16
|
+
|
13
17
|
@compute_service = Fog::Compute.new(RackspaceConfig.load()
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
.merge({
|
19
|
+
:provider => 'Rackspace',
|
20
|
+
:version => :v2,
|
21
|
+
:connection_options => connection_options
|
22
|
+
}))
|
23
|
+
|
20
24
|
# List all servers and filter them based on the passed 'regex_str' parameter
|
21
25
|
@compute_service.list_servers.body['servers']
|
22
26
|
.select { |server| !server['name'].match(/#{regex_str}/).nil? }
|
23
|
-
.flat_map { |s| s[
|
27
|
+
.flat_map { |s| s['addresses'][addr_type.to_s] }
|
24
28
|
.select { |iface| iface['version'] == 4 }
|
25
29
|
.map { |iface| iface['addr'] }
|
26
30
|
.each { |server_addr| server server_addr, { :roles => (roles || %w{app}) } }
|
@@ -31,10 +35,10 @@ module Capistrano
|
|
31
35
|
end
|
32
36
|
|
33
37
|
def rack_autoscale(roles=nil, group_name='')
|
34
|
-
|
35
|
-
|
36
|
-
addr_type = fetch(:rack_addr_type) || :private
|
38
|
+
connection_options ||= fetch(:rack_connection_options) || {}
|
39
|
+
addr_type ||= fetch(:rack_addr_type) || :private
|
37
40
|
|
41
|
+
rackspace_config = RackspaceConfig.load()
|
38
42
|
if !connection_options.empty? then
|
39
43
|
rackspace_config.merge!({:connection_options => connection_options})
|
40
44
|
end
|
@@ -64,5 +68,4 @@ module Capistrano
|
|
64
68
|
end
|
65
69
|
end
|
66
70
|
|
67
|
-
|
68
71
|
self.extend Capistrano::Rack
|
@@ -4,13 +4,13 @@ require 'capistrano/rack/colorize'
|
|
4
4
|
|
5
5
|
class RackspaceConfig
|
6
6
|
def self.load()
|
7
|
-
config_path
|
7
|
+
@config_path ||= fetch(:rack_config) || "#{ENV['HOME']}/.rack/config"
|
8
8
|
|
9
|
-
if !File.exist?(config_path)
|
10
|
-
raise FileNotFoundError, "Rackspace configuration file not found"
|
9
|
+
if !File.exist?(@config_path)
|
10
|
+
raise FileNotFoundError, "Rackspace configuration file not found"
|
11
11
|
end
|
12
12
|
|
13
|
-
props_reader = PropertiesReader.new(config_path)
|
13
|
+
props_reader = PropertiesReader.new(@config_path)
|
14
14
|
return {
|
15
15
|
:rackspace_api_key => props_reader.get("api-key"),
|
16
16
|
:rackspace_username => props_reader.get("username"),
|
metadata
CHANGED
@@ -1,91 +1,109 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Faissal Elamraoui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
20
|
-
- -
|
19
|
+
version: '3.5'
|
20
|
+
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 3.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - ~>
|
27
|
+
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '3.
|
30
|
-
- -
|
29
|
+
version: '3.5'
|
30
|
+
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 3.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: fog
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - ~>
|
37
|
+
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '1.
|
39
|
+
version: '1.38'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- - ~>
|
44
|
+
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '1.
|
46
|
+
version: '1.38'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - ~>
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.12'
|
54
|
+
- - ">="
|
52
55
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
56
|
+
version: 1.12.3
|
54
57
|
type: :development
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
|
-
- - ~>
|
61
|
+
- - "~>"
|
59
62
|
- !ruby/object:Gem::Version
|
60
|
-
version: '1.
|
63
|
+
version: '1.12'
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 1.12.3
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: rake
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
64
70
|
requirements:
|
65
|
-
- - ~>
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '11.1'
|
74
|
+
- - ">="
|
66
75
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
76
|
+
version: 11.1.2
|
68
77
|
type: :development
|
69
78
|
prerelease: false
|
70
79
|
version_requirements: !ruby/object:Gem::Requirement
|
71
80
|
requirements:
|
72
|
-
- - ~>
|
81
|
+
- - "~>"
|
73
82
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
83
|
+
version: '11.1'
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 11.1.2
|
75
87
|
- !ruby/object:Gem::Dependency
|
76
88
|
name: rspec
|
77
89
|
requirement: !ruby/object:Gem::Requirement
|
78
90
|
requirements:
|
79
|
-
- - ~>
|
91
|
+
- - "~>"
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '3.4'
|
94
|
+
- - ">="
|
80
95
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
96
|
+
version: 3.4.0
|
82
97
|
type: :development
|
83
98
|
prerelease: false
|
84
99
|
version_requirements: !ruby/object:Gem::Requirement
|
85
100
|
requirements:
|
86
|
-
- - ~>
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.4'
|
104
|
+
- - ">="
|
87
105
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
106
|
+
version: 3.4.0
|
89
107
|
description: Capistrano recipe to be served with Rackspace
|
90
108
|
email:
|
91
109
|
- amr.faissal@gmail.com
|
@@ -110,17 +128,17 @@ require_paths:
|
|
110
128
|
- lib
|
111
129
|
required_ruby_version: !ruby/object:Gem::Requirement
|
112
130
|
requirements:
|
113
|
-
- -
|
131
|
+
- - ">="
|
114
132
|
- !ruby/object:Gem::Version
|
115
133
|
version: '0'
|
116
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
135
|
requirements:
|
118
|
-
- -
|
136
|
+
- - ">="
|
119
137
|
- !ruby/object:Gem::Version
|
120
138
|
version: '0'
|
121
139
|
requirements: []
|
122
140
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.5.1
|
124
142
|
signing_key:
|
125
143
|
specification_version: 4
|
126
144
|
summary: Capistrano with Rackspace
|