madscience 0.0.17 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/madscience +20 -11
- data/lib/madscience/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1ff95532387f998abdddfd31a6bc077bab327e1
|
4
|
+
data.tar.gz: 2d36f07a338ae5d6c1684388ea027c83925d318c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3e8fa586229649f00a18e723b5fa7da2496044d53dbb09d824449c91f7bc03a2568758766fe41e718bf8334d0e65b4751e625377afbac98292b840329079fa6
|
7
|
+
data.tar.gz: 90e4c34b909569fe1d0daa331834d60b26f43804e745a58e4b3744a07c0dd2012ba739f7c149375ee60bb688e6c4a50db33c796022dd0294789290f06cbd2881
|
data/bin/madscience
CHANGED
@@ -31,16 +31,22 @@ end
|
|
31
31
|
require "madscience"
|
32
32
|
require "madscience/version"
|
33
33
|
|
34
|
-
|
34
|
+
def in_madscience_dir
|
35
|
+
initial_dir = Dir.pwd
|
35
36
|
|
36
|
-
# Change to MadScience dir to get correct Gemfile
|
37
|
-
ms_path = $LOAD_PATH.detect { |p| File.exist? File.join(p, "..", ".madscience_gem_location") }
|
38
|
-
raise "Can't find MadScience gem in $LOAD_PATH: #{$LOAD_PATH.inspect}!" unless ms_path
|
39
|
-
Dir.chdir File.join(ms_path, "..")
|
37
|
+
# Change to MadScience dir to get correct Gemfile
|
38
|
+
ms_path = $LOAD_PATH.detect { |p| File.exist? File.join(p, "..", ".madscience_gem_location") }
|
39
|
+
raise "Can't find MadScience gem in $LOAD_PATH: #{$LOAD_PATH.inspect}!" unless ms_path
|
40
|
+
Dir.chdir File.join(ms_path, "..")
|
41
|
+
|
42
|
+
yield
|
43
|
+
|
44
|
+
Dir.chdir initial_dir
|
45
|
+
end
|
40
46
|
|
41
47
|
# Set up Bundler with the MadScience gem's Gemfile
|
42
48
|
require "bundler"
|
43
|
-
Bundler.setup
|
49
|
+
in_madscience_dir { Bundler.setup }
|
44
50
|
|
45
51
|
def check_superuser
|
46
52
|
raise "Must run as superuser!" unless Process.uid == 0
|
@@ -57,12 +63,15 @@ def get_sudo_uid
|
|
57
63
|
end
|
58
64
|
|
59
65
|
def drop_sudo_privileges
|
60
|
-
Process.setuid
|
66
|
+
Process::Sys.setuid get_sudo_uid
|
61
67
|
end
|
62
68
|
|
63
69
|
def do_local_setup
|
64
|
-
|
65
|
-
|
70
|
+
in_madscience_dir do
|
71
|
+
system("librarian-chef", "install")
|
72
|
+
system("chown -R #{get_sudo_user} cookbooks")
|
73
|
+
system("chef-solo", "-c", "solo.rb") or raise "Failed during chef run!"
|
74
|
+
end
|
66
75
|
end
|
67
76
|
|
68
77
|
def do_clone
|
@@ -113,7 +122,7 @@ end
|
|
113
122
|
if ARGV[0] == "clone"
|
114
123
|
do_clone
|
115
124
|
|
116
|
-
puts "Successfully cloned repo
|
125
|
+
puts "Successfully cloned repo under this directory. Now customize nodes/all_nodes.json.erb!"
|
117
126
|
exit 0
|
118
127
|
end
|
119
128
|
|
@@ -126,7 +135,7 @@ if ARGV[0] == "setup_clone_and_deploy"
|
|
126
135
|
do_clone
|
127
136
|
do_deploy
|
128
137
|
|
129
|
-
puts "Successfully cloned repo
|
138
|
+
puts "Successfully cloned repo #{MADSCIENCE_REPO_URL} under this directory. Now customize nodes/all_nodes.json.erb!"
|
130
139
|
exit 0
|
131
140
|
end
|
132
141
|
|
data/lib/madscience/version.rb
CHANGED