Skip to content

Commit a71c43d

Browse files
committed
Resources for revision deployment strategy
1 parent 8ee3c17 commit a71c43d

4 files changed

Lines changed: 130 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# Author:: Daniel DeLeo (<dan@kallistec.com>)
3+
# Copyright:: Copyright (c) 2009 Daniel DeLeo
4+
# License:: Apache License, Version 2.0
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
class Chef
20+
class Resource
21+
22+
# Convenience class for using the deploy resource with the revision
23+
# deployment strategy (provider)
24+
class DeployRevision < Chef::Resource::Deploy
25+
def initialize(*args, &block)
26+
super
27+
@provider = Chef::Provider::Deploy::Revision
28+
end
29+
end
30+
31+
class DeployBranch < Chef::Resource::DeployRevision
32+
end
33+
34+
end
35+
end
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# Author:: Daniel DeLeo (<dan@kallistec.com>)
3+
# Copyright:: Copyright (c) 2009 Daniel DeLeo
4+
# License:: Apache License, Version 2.0
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
class Chef
20+
class Resource
21+
22+
# Convenience class for using the deploy resource with the timestamped
23+
# deployment strategy (provider)
24+
class TimestampedDeploy < Chef::Resource::Deploy
25+
def initialize(*args, &block)
26+
@provider = Chef::Provider::Deploy::Timestamped
27+
end
28+
end
29+
end
30+
end
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#
2+
# Author:: Daniel DeLeo (<dan@kallistec.com>)
3+
# Copyright:: Copyright (c) 2009 Daniel DeLeo
4+
# License:: Apache License, Version 2.0
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "spec_helper"))
20+
21+
describe Chef::Resource::DeployRevision do
22+
23+
it "defaults to the revision deploy provider" do
24+
@resource = Chef::Resource::DeployRevision.new("deploy _this_!")
25+
@resource.provider.should == Chef::Provider::Deploy::Revision
26+
end
27+
28+
end
29+
30+
describe Chef::Resource::DeployBranch do
31+
32+
it "defaults to the revision deploy provider" do
33+
@resource = Chef::Resource::DeployBranch.new("deploy _this_!")
34+
@resource.provider.should == Chef::Provider::Deploy::Revision
35+
end
36+
37+
end
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Author:: Daniel DeLeo (<dan@kallistec.com>)
3+
# Copyright:: Copyright (c) 2009 Daniel DeLeo
4+
# License:: Apache License, Version 2.0
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "spec_helper"))
20+
21+
describe Chef::Resource::TimestampedDeploy do
22+
23+
it "defaults to the TimestampedDeploy provider" do
24+
@resource = Chef::Resource::TimestampedDeploy.new("stuff")
25+
@resource.provider.should == Chef::Provider::Deploy::Timestamped
26+
end
27+
28+
end

0 commit comments

Comments
 (0)