summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/provider/deploy.rb3
-rw-r--r--spec/unit/provider/deploy_spec.rb4
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/provider/deploy.rb b/lib/chef/provider/deploy.rb
index b3e459d434..426e69644e 100644
--- a/lib/chef/provider/deploy.rb
+++ b/lib/chef/provider/deploy.rb
@@ -31,7 +31,7 @@ class Chef
include Chef::Mixin::FromFile
include Chef::Mixin::Command
- attr_reader :scm_provider, :release_path, :previous_release_path
+ attr_reader :scm_provider, :release_path, :shared_path, :previous_release_path
def initialize(new_resource, run_context)
super(new_resource, run_context)
@@ -53,6 +53,7 @@ class Chef
def load_current_resource
@scm_provider.load_current_resource
@release_path = @new_resource.deploy_to + "/releases/#{release_slug}"
+ @shared_path = @new_resource.shared_path
end
def sudo(command,&block)
diff --git a/spec/unit/provider/deploy_spec.rb b/spec/unit/provider/deploy_spec.rb
index e6e4566011..c6df0d4fdf 100644
--- a/spec/unit/provider/deploy_spec.rb
+++ b/spec/unit/provider/deploy_spec.rb
@@ -192,6 +192,7 @@ describe Chef::Provider::Deploy do
FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/5")
@provider.run_action(:rollback)
@provider.release_path.should eql("/my/deploy/dir/releases/3")
+ @provider.shared_path.should eql("/my/deploy/dir/shared")
end
it "sets the release path to the specified release, symlinks, and rm's any newer releases on rollback" do
@@ -203,6 +204,7 @@ describe Chef::Provider::Deploy do
FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342")
@provider.run_action(:rollback)
@provider.release_path.should eql("/my/deploy/dir/releases/20040700000000")
+ @provider.shared_path.should eql("/my/deploy/dir/shared")
end
it "sets the release path to the penultimate release, symlinks, and rm's the last release on rollback" do
@@ -216,6 +218,7 @@ describe Chef::Provider::Deploy do
FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342")
@provider.run_action(:rollback)
@provider.release_path.should eql("/my/deploy/dir/releases/20040700000000")
+ @provider.shared_path.should eql("/my/deploy/dir/shared")
end
describe "if there are no releases to fallback to" do
@@ -255,6 +258,7 @@ describe Chef::Provider::Deploy do
FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342")
@provider.run_action(:rollback)
@provider.release_path.should eql("/my/deploy/dir/releases/20040700000000")
+ @provider.shared_path.should eql("/my/deploy/dir/shared")
end
end