chef-server-api 0.8.16 → 0.9.0.a3
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/Rakefile +13 -9
- data/app/controllers/application.rb +19 -202
- data/app/controllers/clients.rb +5 -5
- data/app/controllers/cookbooks.rb +79 -155
- data/app/controllers/{data.rb → data_bags.rb} +4 -4
- data/app/controllers/data_item.rb +1 -1
- data/app/controllers/exceptions.rb +1 -1
- data/app/controllers/main.rb +6 -6
- data/app/controllers/nodes.rb +72 -10
- data/app/controllers/roles.rb +3 -3
- data/app/controllers/sandboxes.rb +179 -0
- data/app/controllers/search.rb +8 -8
- data/app/controllers/users.rb +17 -17
- data/app/helpers/tarball_helper.rb +84 -54
- data/app/views/layout/chef_server_api.html.haml +1 -1
- data/bin/chef-server +75 -0
- data/config/environments/development.rb +6 -0
- data/config/init.rb +55 -12
- data/config/rack.rb +5 -0
- data/config/router.rb +81 -5
- data/lib/chef-server-api.rb +2 -158
- data/lib/chef-server-api/version.rb +3 -0
- metadata +56 -43
- data/app/helpers/application_helper.rb +0 -163
- data/app/helpers/exceptions_helper.rb +0 -6
- data/app/helpers/global_helpers.rb +0 -25
- data/app/helpers/nodes_helper.rb +0 -26
- data/app/helpers/roles_helper.rb +0 -5
- data/lib/chef-server-api/merbtasks.rb +0 -103
- data/lib/chef-server-api/slicetasks.rb +0 -20
- data/lib/chef-server-api/spectasks.rb +0 -53
- data/stubs/app/controllers/application.rb +0 -2
- data/stubs/app/controllers/main.rb +0 -2
@@ -1,25 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Adam Jacob (<adam@opscode.com>)
|
3
|
-
# Copyright:: Copyright (c) 2008 Opscode, Inc.
|
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
|
-
module Merb
|
20
|
-
module ChefServerApi
|
21
|
-
|
22
|
-
module GlobalHelpers
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/app/helpers/nodes_helper.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Adam Jacob (<adam@opscode.com>)
|
3
|
-
# Author:: AJ Christensen (<aj@junglist.gen.nz>)
|
4
|
-
# Copyright:: Copyright (c) 2008 Opscode, Inc.
|
5
|
-
# License:: Apache License, Version 2.0
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
#
|
19
|
-
|
20
|
-
module Merb
|
21
|
-
module ChefServerApi
|
22
|
-
module NodesHelper
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
data/app/helpers/roles_helper.rb
DELETED
@@ -1,103 +0,0 @@
|
|
1
|
-
namespace :slices do
|
2
|
-
namespace :chefserverslice do
|
3
|
-
|
4
|
-
desc "Install Chefserver"
|
5
|
-
task :install => [:preflight, :setup_directories, :copy_assets, :migrate]
|
6
|
-
|
7
|
-
desc "Test for any dependencies"
|
8
|
-
task :preflight do # see slicetasks.rb
|
9
|
-
end
|
10
|
-
|
11
|
-
desc "Setup directories"
|
12
|
-
task :setup_directories do
|
13
|
-
puts "Creating directories for host application"
|
14
|
-
ChefServerApi.mirrored_components.each do |type|
|
15
|
-
if File.directory?(ChefServerApi.dir_for(type))
|
16
|
-
if !File.directory?(dst_path = ChefServerApi.app_dir_for(type))
|
17
|
-
relative_path = dst_path.relative_path_from(Merb.root)
|
18
|
-
puts "- creating directory :#{type} #{File.basename(Merb.root) / relative_path}"
|
19
|
-
mkdir_p(dst_path)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
# desc "Copy stub files to host application"
|
26
|
-
# task :stubs do
|
27
|
-
# puts "Copying stubs for ChefServerApi - resolves any collisions"
|
28
|
-
# copied, preserved = ChefServerApi.mirror_stubs!
|
29
|
-
# puts "- no files to copy" if copied.empty? && preserved.empty?
|
30
|
-
# copied.each { |f| puts "- copied #{f}" }
|
31
|
-
# preserved.each { |f| puts "! preserved override as #{f}" }
|
32
|
-
# end
|
33
|
-
|
34
|
-
# desc "Copy stub files and views to host application"
|
35
|
-
# task :patch => [ "stubs", "freeze:views" ]
|
36
|
-
|
37
|
-
desc "Copy public assets to host application"
|
38
|
-
task :copy_assets do
|
39
|
-
puts "Copying assets for ChefServerApi - resolves any collisions"
|
40
|
-
copied, preserved = ChefServerApi.mirror_public!
|
41
|
-
puts "- no files to copy" if copied.empty? && preserved.empty?
|
42
|
-
copied.each { |f| puts "- copied #{f}" }
|
43
|
-
preserved.each { |f| puts "! preserved override as #{f}" }
|
44
|
-
end
|
45
|
-
|
46
|
-
desc "Migrate the database"
|
47
|
-
task :migrate do # see slicetasks.rb
|
48
|
-
end
|
49
|
-
|
50
|
-
desc "Freeze ChefServerApi into your app (only chefserverslice/app)"
|
51
|
-
task :freeze => [ "freeze:app" ]
|
52
|
-
|
53
|
-
namespace :freeze do
|
54
|
-
|
55
|
-
# desc "Freezes ChefServerApi by installing the gem into application/gems"
|
56
|
-
# task :gem do
|
57
|
-
# ENV["GEM"] ||= "chefserverslice"
|
58
|
-
# Rake::Task['slices:install_as_gem'].invoke
|
59
|
-
# end
|
60
|
-
|
61
|
-
desc "Freezes ChefServerApi by copying all files from chefserverslice/app to your application"
|
62
|
-
task :app do
|
63
|
-
puts "Copying all chefserverslice/app files to your application - resolves any collisions"
|
64
|
-
copied, preserved = ChefServerApi.mirror_app!
|
65
|
-
puts "- no files to copy" if copied.empty? && preserved.empty?
|
66
|
-
copied.each { |f| puts "- copied #{f}" }
|
67
|
-
preserved.each { |f| puts "! preserved override as #{f}" }
|
68
|
-
end
|
69
|
-
|
70
|
-
desc "Freeze all views into your application for easy modification"
|
71
|
-
task :views do
|
72
|
-
puts "Copying all view templates to your application - resolves any collisions"
|
73
|
-
copied, preserved = ChefServerApi.mirror_files_for :view
|
74
|
-
puts "- no files to copy" if copied.empty? && preserved.empty?
|
75
|
-
copied.each { |f| puts "- copied #{f}" }
|
76
|
-
preserved.each { |f| puts "! preserved override as #{f}" }
|
77
|
-
end
|
78
|
-
|
79
|
-
desc "Freeze all models into your application for easy modification"
|
80
|
-
task :models do
|
81
|
-
puts "Copying all models to your application - resolves any collisions"
|
82
|
-
copied, preserved = ChefServerApi.mirror_files_for :model
|
83
|
-
puts "- no files to copy" if copied.empty? && preserved.empty?
|
84
|
-
copied.each { |f| puts "- copied #{f}" }
|
85
|
-
preserved.each { |f| puts "! preserved override as #{f}" }
|
86
|
-
end
|
87
|
-
|
88
|
-
desc "Freezes ChefServerApi as a gem and copies over chefserver/app"
|
89
|
-
task :app_with_gem => [:gem, :app]
|
90
|
-
|
91
|
-
desc "Freezes ChefServerApi by unpacking all files into your application"
|
92
|
-
task :unpack do
|
93
|
-
puts "Unpacking ChefServerApi files to your application - resolves any collisions"
|
94
|
-
copied, preserved = ChefServerApi.unpack_slice!
|
95
|
-
puts "- no files to copy" if copied.empty? && preserved.empty?
|
96
|
-
copied.each { |f| puts "- copied #{f}" }
|
97
|
-
preserved.each { |f| puts "! preserved override as #{f}" }
|
98
|
-
end
|
99
|
-
|
100
|
-
end
|
101
|
-
|
102
|
-
end
|
103
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
namespace :slices do
|
2
|
-
namespace :chefserverslice do
|
3
|
-
|
4
|
-
# add your own chefserver tasks here
|
5
|
-
|
6
|
-
# # Uncomment the following lines and edit the pre defined tasks
|
7
|
-
#
|
8
|
-
# # implement this to test for structural/code dependencies
|
9
|
-
# # like certain directories or availability of other files
|
10
|
-
# desc "Test for any dependencies"
|
11
|
-
# task :preflight do
|
12
|
-
# end
|
13
|
-
#
|
14
|
-
# # implement this to perform any database related setup steps
|
15
|
-
# desc "Migrate the database"
|
16
|
-
# task :migrate do
|
17
|
-
# end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
namespace :slices do
|
2
|
-
namespace :chefserverslice do
|
3
|
-
|
4
|
-
desc "Run slice specs within the host application context"
|
5
|
-
task :spec => [ "spec:explain", "spec:default" ]
|
6
|
-
|
7
|
-
namespace :spec do
|
8
|
-
|
9
|
-
slice_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
|
10
|
-
|
11
|
-
task :explain do
|
12
|
-
puts "\nNote: By running ChefServerApi specs inside the application context any\n" +
|
13
|
-
"overrides could break existing specs. This isn't always a problem,\n" +
|
14
|
-
"especially in the case of views. Use these spec tasks to check how\n" +
|
15
|
-
"well your application conforms to the original slice implementation."
|
16
|
-
end
|
17
|
-
|
18
|
-
Spec::Rake::SpecTask.new('default') do |t|
|
19
|
-
t.spec_opts = ["--format", "specdoc", "--colour"]
|
20
|
-
t.spec_files = Dir["#{slice_root}/spec/**/*_spec.rb"].sort
|
21
|
-
end
|
22
|
-
|
23
|
-
desc "Run all model specs, run a spec for a specific Model with MODEL=MyModel"
|
24
|
-
Spec::Rake::SpecTask.new('model') do |t|
|
25
|
-
t.spec_opts = ["--format", "specdoc", "--colour"]
|
26
|
-
if(ENV['MODEL'])
|
27
|
-
t.spec_files = Dir["#{slice_root}/spec/models/**/#{ENV['MODEL']}_spec.rb"].sort
|
28
|
-
else
|
29
|
-
t.spec_files = Dir["#{slice_root}/spec/models/**/*_spec.rb"].sort
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
desc "Run all request specs, run a spec for a specific request with REQUEST=MyRequest"
|
34
|
-
Spec::Rake::SpecTask.new('request') do |t|
|
35
|
-
t.spec_opts = ["--format", "specdoc", "--colour"]
|
36
|
-
if(ENV['REQUEST'])
|
37
|
-
t.spec_files = Dir["#{slice_root}/spec/requests/**/#{ENV['REQUEST']}_spec.rb"].sort
|
38
|
-
else
|
39
|
-
t.spec_files = Dir["#{slice_root}/spec/requests/**/*_spec.rb"].sort
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
desc "Run all specs and output the result in html"
|
44
|
-
Spec::Rake::SpecTask.new('html') do |t|
|
45
|
-
t.spec_opts = ["--format", "html"]
|
46
|
-
t.libs = ['lib', 'server/lib' ]
|
47
|
-
t.spec_files = Dir["#{slice_root}/spec/**/*_spec.rb"].sort
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
53
|
-
end
|