sbfaulkner-astrovan 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +0 -2
- data/VERSION.yml +1 -1
- data/lib/astrovan/deploy.rb +7 -8
- data/lib/astrovan/update.rb +3 -0
- data/lib/astrovan/util.rb +1 -1
- data/test/util_test.rb +2 -0
- metadata +1 -1
data/README.rdoc
CHANGED
data/VERSION.yml
CHANGED
data/lib/astrovan/deploy.rb
CHANGED
@@ -28,19 +28,13 @@ module Astrovan
|
|
28
28
|
self.release_path = release_path = File.join(releases_path, release_name)
|
29
29
|
self.env = options[:env] || self.env
|
30
30
|
self.rakefile = options[:rakefile] || self.rakefile
|
31
|
+
self.current_path = current_path = File.join(deploy_to, 'current')
|
31
32
|
|
32
33
|
if block_given?
|
33
34
|
yield
|
34
35
|
else
|
35
|
-
|
36
|
-
dirs = [deploy_to, releases_path, shared_path]
|
37
|
-
# TODO: these shared children are rails specific... come up with another plan
|
38
|
-
# shared_children = %w(system log pids)
|
39
|
-
# dirs += shared_children.map { |d| File.join(shared_path, d) }
|
40
|
-
mkdir(dirs, options)
|
41
|
-
|
36
|
+
mkdir deploy_to, releases_path, shared_path, options
|
42
37
|
update options
|
43
|
-
|
44
38
|
end
|
45
39
|
rescue => e
|
46
40
|
# TODO: rollback
|
@@ -49,5 +43,10 @@ module Astrovan
|
|
49
43
|
ensure
|
50
44
|
self.environment.replace original_environment
|
51
45
|
end
|
46
|
+
|
47
|
+
# Create a symlink from a file or directory in the shared folder into the current release.
|
48
|
+
def share(path, options = {})
|
49
|
+
symlink "#{shared_path}/#{path}", options.merge(:to => "#{release_path}/#{path}")
|
50
|
+
end
|
52
51
|
end
|
53
52
|
end
|
data/lib/astrovan/update.rb
CHANGED
@@ -6,6 +6,7 @@ module Astrovan
|
|
6
6
|
shared_repository = self.shared_repository
|
7
7
|
repository = self.repository
|
8
8
|
release_path = self.release_path
|
9
|
+
current_path = self.current_path
|
9
10
|
|
10
11
|
# TODO: do we need branch support, submodule config, etc?
|
11
12
|
exec <<-END, options
|
@@ -19,6 +20,8 @@ module Astrovan
|
|
19
20
|
git clone #{shared_repository} #{release_path}
|
20
21
|
END
|
21
22
|
|
23
|
+
symlink release_path, options.merge(:to => current_path)
|
24
|
+
|
22
25
|
yield if block_given?
|
23
26
|
rescue => e
|
24
27
|
# TODO: rollback
|
data/lib/astrovan/util.rb
CHANGED
data/test/util_test.rb
CHANGED
@@ -58,6 +58,8 @@ class UtilTest < Test::Unit::TestCase
|
|
58
58
|
using 'astrovan.local', :password => ENV['PASSWORD'], :path => @path, :target => target do
|
59
59
|
symlink path, :to => target
|
60
60
|
end
|
61
|
+
assert File.exist?(target)
|
62
|
+
assert File.symlink?(target)
|
61
63
|
assert_equal data, File.open(target) { |f| f.gets.chomp }
|
62
64
|
end
|
63
65
|
|