Devops 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/ops +23 -16
- data/lib/ops/common.rb +4 -1
- data/lib/ops/console.rb +4 -0
- data/lib/tasks/hosts.rb +16 -3
- data/lib/tasks/ops.rb +1 -2
- data/lib/version.rb +1 -1
- data/spec/lib/host/{default.rb → default_spec.rb} +0 -0
- data/spec/lib/host/{list.rb → list_spec.rb} +0 -0
- metadata +4 -4
data/bin/ops
CHANGED
@@ -9,26 +9,33 @@ end
|
|
9
9
|
bootstrap_files = [
|
10
10
|
File.join( 'tasks', 'init.rb' ) ]
|
11
11
|
|
12
|
-
|
12
|
+
Dir.chdir Ops::pwd_dir do
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
File.join Ops::root_dir, f
|
17
|
-
require f
|
14
|
+
unless Ops::pwd_dir == Dir.pwd
|
15
|
+
puts "Executing from ( #{ Ops::pwd_dir } )".warning
|
18
16
|
end
|
19
|
-
rescue => e
|
20
|
-
puts e
|
21
|
-
end
|
22
17
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
Rake.application.init( File.basename( $0 ) )
|
19
|
+
|
20
|
+
begin
|
21
|
+
bootstrap_files.each do | f |
|
22
|
+
File.join Ops::root_dir, f
|
23
|
+
require f
|
24
|
+
end
|
25
|
+
rescue => e
|
26
|
+
puts e
|
27
|
+
end
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
bootstrap_files.each do | f |
|
30
|
+
f = File.join Ops::pwd_dir, f
|
31
|
+
require f if File.exists? f
|
32
|
+
end
|
33
|
+
|
34
|
+
begin
|
35
|
+
Rake.application.top_level
|
36
|
+
rescue => e
|
37
|
+
puts "Failed to call task: #{ e.message }"
|
38
|
+
end
|
32
39
|
end
|
33
40
|
|
34
41
|
exit
|
data/lib/ops/common.rb
CHANGED
data/lib/ops/console.rb
CHANGED
data/lib/tasks/hosts.rb
CHANGED
@@ -21,7 +21,17 @@ namespace "hosts" do
|
|
21
21
|
host = ENV[ 'host' ]
|
22
22
|
user = ENV[ 'user' ]
|
23
23
|
type = ENV[ 'type' ] || "default"
|
24
|
-
identity =
|
24
|
+
identity = nil
|
25
|
+
tags = {}
|
26
|
+
|
27
|
+
unless ENV[ 'identity' ].nil?
|
28
|
+
identity = File.basename( ENV[ 'identity' ] )
|
29
|
+
end
|
30
|
+
|
31
|
+
unless ENV[ 'tags' ].nil?
|
32
|
+
tags = File.basename( ENV[ 'tags' ] )
|
33
|
+
tags = JSON.parse( tags )
|
34
|
+
end
|
25
35
|
|
26
36
|
|
27
37
|
puts "Adding host: #{ host }"
|
@@ -31,7 +41,9 @@ namespace "hosts" do
|
|
31
41
|
hosts = {}
|
32
42
|
hosts_file = File.join( pwd, "hosts.json" )
|
33
43
|
|
34
|
-
|
44
|
+
if File.exists? hosts_file
|
45
|
+
hosts = JSON.parse( File.read( hosts_file ) )
|
46
|
+
end
|
35
47
|
|
36
48
|
exit_failure( "Error: #{ host } is already defined" ) if
|
37
49
|
hosts.has_key? host
|
@@ -40,7 +52,8 @@ namespace "hosts" do
|
|
40
52
|
'HostName' => hostname,
|
41
53
|
'User' => user,
|
42
54
|
'IdentityFile' => identity,
|
43
|
-
"Type" => "type"
|
55
|
+
"Type" => "type",
|
56
|
+
"Tags" => tags
|
44
57
|
}
|
45
58
|
|
46
59
|
File.open( hosts_file, 'w' ) { | f | f.write( hosts.to_json ) }
|
data/lib/tasks/ops.rb
CHANGED
data/lib/version.rb
CHANGED
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Devops
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-04-
|
13
|
+
date: 2013-04-29 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Ops tool for remote servers
|
16
16
|
email: hardeepshoker@gmail.com
|
@@ -43,8 +43,8 @@ files:
|
|
43
43
|
- res/samples/default/config.json
|
44
44
|
- res/strings/strings.yml
|
45
45
|
- res/strings/tasks/hosts.yml
|
46
|
-
- spec/lib/host/
|
47
|
-
- spec/lib/host/
|
46
|
+
- spec/lib/host/default_spec.rb
|
47
|
+
- spec/lib/host/list_spec.rb
|
48
48
|
- spec/spec_helper.rb
|
49
49
|
homepage: https://github.com/hardeep/ops
|
50
50
|
licenses: []
|