solokit 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/lib/chef.rb +8 -5
- data/lib/solokit/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
data/lib/chef.rb
CHANGED
@@ -2,8 +2,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'ssh.rb'))
|
|
2
2
|
|
3
3
|
module Solokit
|
4
4
|
class Chef
|
5
|
-
TEMP_PATH="/tmp/solokit_upload"
|
6
|
-
|
7
5
|
def initialize(ip, name, env, debug_ssh, user = 'root')
|
8
6
|
@ip, @name, @env = ip, name, env
|
9
7
|
@ssh = SSH.new(ip, user, debug_ssh)
|
@@ -18,7 +16,7 @@ module Solokit
|
|
18
16
|
def upload(root = "/")
|
19
17
|
solokit_path = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
20
18
|
|
21
|
-
system("rm -rf #{
|
19
|
+
system("rm -rf #{temp_path}")
|
22
20
|
add_upload("#{solokit_path}/cookbooks/upstream/*", "#{root}var/chef-solo/upstream-cookbooks") &&
|
23
21
|
add_upload("#{solokit_path}/cookbooks/site/*", "#{root}var/chef-solo/site-cookbooks") &&
|
24
22
|
add_upload("cookbooks/upstream/*", "#{root}var/chef-solo/upstream-cookbooks") &&
|
@@ -28,7 +26,8 @@ module Solokit
|
|
28
26
|
add_upload("chef/*", "#{root}etc/chef") &&
|
29
27
|
add_upload("envs/#{@env}/chef/*", "#{root}etc/chef") &&
|
30
28
|
@ssh.run("rm -rf #{root}var/chef-solo #{root}etc/chef", false) &&
|
31
|
-
@ssh.rsync("#{
|
29
|
+
@ssh.rsync("#{temp_path}#{root}", root, true) &&
|
30
|
+
system("rm -rf #{temp_path}")
|
32
31
|
end
|
33
32
|
|
34
33
|
def run(debug = false, root = "/")
|
@@ -49,13 +48,17 @@ module Solokit
|
|
49
48
|
|
50
49
|
private
|
51
50
|
|
51
|
+
def temp_path
|
52
|
+
"/tmp/solokit_upload/#{@env}-#{@name}-#{@ip}"
|
53
|
+
end
|
54
|
+
|
52
55
|
def custom_ruby_path(root)
|
53
56
|
"PATH=\"#{root}ruby/bin:/sbin:$PATH\""
|
54
57
|
end
|
55
58
|
|
56
59
|
def add_upload(from, to)
|
57
60
|
if File.exists?(from.gsub(/\*/, ''))
|
58
|
-
system("mkdir -p #{
|
61
|
+
system("mkdir -p #{temp_path}#{to} && cp -rf #{from} #{temp_path}#{to}")
|
59
62
|
else
|
60
63
|
true
|
61
64
|
end
|
data/lib/solokit/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solokit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Joakim Kolsj\xC3\xB6"
|