sahara 0.0.5 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +5 -5
- data/README.md +4 -4
- data/lib/sahara/session.rb +22 -4
- data/lib/sahara/version.rb +1 -1
- data/sahara.gemspec +1 -1
- metadata +7 -7
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sahara (0.0.
|
4
|
+
sahara (0.0.8)
|
5
5
|
popen4 (~> 0.1.2)
|
6
6
|
thor (~> 0.14.6)
|
7
|
-
vagrant (~> 0.8.
|
7
|
+
vagrant (~> 0.8.2)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
@@ -23,7 +23,7 @@ GEM
|
|
23
23
|
Platform (>= 0.4.0)
|
24
24
|
open4 (>= 0.4.0)
|
25
25
|
thor (0.14.6)
|
26
|
-
vagrant (0.8.
|
26
|
+
vagrant (0.8.2)
|
27
27
|
archive-tar-minitar (= 0.5.2)
|
28
28
|
erubis (~> 2.7.0)
|
29
29
|
i18n (~> 0.5.0)
|
@@ -31,8 +31,8 @@ GEM
|
|
31
31
|
net-scp (~> 1.0.4)
|
32
32
|
net-ssh (~> 2.1.4)
|
33
33
|
thor (~> 0.14.6)
|
34
|
-
virtualbox (~> 0.9.
|
35
|
-
virtualbox (0.9.
|
34
|
+
virtualbox (~> 0.9.1)
|
35
|
+
virtualbox (0.9.1)
|
36
36
|
ffi (~> 1.0.9)
|
37
37
|
|
38
38
|
PLATFORMS
|
data/README.md
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# Description
|
2
2
|
|
3
|
-
Sahara allows vagrant to operate in sandbox mode
|
3
|
+
Sahara allows vagrant to operate in sandbox mode.
|
4
4
|
|
5
5
|
Typical usage:
|
6
6
|
|
7
7
|
- Enter sandbox mode: <pre>vagrant sandbox on</pre>
|
8
8
|
- Do some stuff: <pre>vagrant ssh </pre>
|
9
|
-
- If satisfied apply the changes: <pre>vagrant sandbox commit</pre>
|
10
|
-
- If not satisfied
|
11
|
-
-
|
9
|
+
- If satisfied, apply the changes permanently: <pre>vagrant sandbox commit</pre>
|
10
|
+
- If not satisfied, rollback to the previous commit: <pre>vagrant sandbox rollback</pre>
|
11
|
+
- Exit sandbox mode: <pre>vagrant sandbox off</pre>
|
12
12
|
|
13
13
|
Many kudos go to the creators of [vagrant](http://vagrantup.com)
|
14
14
|
|
data/lib/sahara/session.rb
CHANGED
@@ -40,7 +40,7 @@ module Sahara
|
|
40
40
|
#Creating a snapshot
|
41
41
|
puts "[#{boxname}] - Enabling sandbox"
|
42
42
|
|
43
|
-
execute("#{@vboxcmd} snapshot '#{instance_name}' take '#{@sandboxname}'")
|
43
|
+
execute("#{@vboxcmd} snapshot '#{instance_name}' take '#{@sandboxname}' --pause")
|
44
44
|
end
|
45
45
|
|
46
46
|
end
|
@@ -64,7 +64,7 @@ module Sahara
|
|
64
64
|
#Now retake the snapshot
|
65
65
|
puts "[#{boxname}] - fastforwarding sandbox"
|
66
66
|
|
67
|
-
execute("#{@vboxcmd} snapshot '#{instance_name}' take '#{@sandboxname}'")
|
67
|
+
execute("#{@vboxcmd} snapshot '#{instance_name}' take '#{@sandboxname}' --pause")
|
68
68
|
|
69
69
|
end
|
70
70
|
|
@@ -87,6 +87,10 @@ module Sahara
|
|
87
87
|
#Poweroff machine
|
88
88
|
execute("#{@vboxcmd} controlvm '#{instance_name}' poweroff")
|
89
89
|
|
90
|
+
#Poweroff takes a second or so to complete; Virtualbox will throw errors
|
91
|
+
#if you try to restore a snapshot before it's ready.
|
92
|
+
sleep 2
|
93
|
+
|
90
94
|
puts "[#{boxname}] - roll back machine"
|
91
95
|
|
92
96
|
#Rollback until snapshot
|
@@ -95,8 +99,22 @@ module Sahara
|
|
95
99
|
puts "[#{boxname}] - starting the machine again"
|
96
100
|
|
97
101
|
#Startvm again
|
98
|
-
|
99
|
-
|
102
|
+
#
|
103
|
+
# Grab the boot_mode setting from the Vagrantfile
|
104
|
+
config_boot_mode="#{@vagrant_env.config.vm.boot_mode.to_s}"
|
105
|
+
|
106
|
+
case config_boot_mode
|
107
|
+
when 'vrdp'
|
108
|
+
boot_mode='headless'
|
109
|
+
when 'gui'
|
110
|
+
boot_mode='gui'
|
111
|
+
else
|
112
|
+
puts "Vagrantfile config.vm.boot_mode=#{config_boot_mode} setting unknown - defaulting to headless"
|
113
|
+
boot_mode='headless'
|
114
|
+
end
|
115
|
+
|
116
|
+
execute("#{@vboxcmd} startvm --type #{boot_mode} '#{instance_name}' ")
|
117
|
+
|
100
118
|
end
|
101
119
|
|
102
120
|
end
|
data/lib/sahara/version.rb
CHANGED
data/sahara.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.required_rubygems_version = ">= 1.3.6"
|
15
15
|
s.rubyforge_project = "sahara"
|
16
16
|
|
17
|
-
s.add_dependency "vagrant", "~> 0.8.
|
17
|
+
s.add_dependency "vagrant", "~> 0.8.2"
|
18
18
|
s.add_dependency "popen4", "~> 0.1.2"
|
19
19
|
s.add_dependency "thor", "~> 0.14.6"
|
20
20
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sahara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 8
|
10
|
+
version: 0.0.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Patrick Debois
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-11-14 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -24,12 +24,12 @@ dependencies:
|
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
hash:
|
27
|
+
hash: 59
|
28
28
|
segments:
|
29
29
|
- 0
|
30
30
|
- 8
|
31
|
-
-
|
32
|
-
version: 0.8.
|
31
|
+
- 2
|
32
|
+
version: 0.8.2
|
33
33
|
type: :runtime
|
34
34
|
requirement: *id001
|
35
35
|
name: vagrant
|