summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Brown <cb@opscode.com>2009-02-20 15:30:01 -0800
committerChristopher Brown <cb@opscode.com>2009-02-20 15:30:01 -0800
commitf975e77dc070b226c49ad70d1ed5e1ee9082bca3 (patch)
treea2a5d147a03e2b42c61c086b733abe61b182b68e
parent89982cd86f3ed6341fcf673861a57c328e714283 (diff)
downloadchef-f975e77dc070b226c49ad70d1ed5e1ee9082bca3.tar.gz
added executable wrapper, updated package task, removed node path from server.rb
-rw-r--r--chef-server/bin/chef-server46
-rw-r--r--chef-server/lib/tasks/package.rake1
-rw-r--r--chef/config/server.rb3
3 files changed, 47 insertions, 3 deletions
diff --git a/chef-server/bin/chef-server b/chef-server/bin/chef-server
new file mode 100644
index 0000000000..a68cf1b202
--- /dev/null
+++ b/chef-server/bin/chef-server
@@ -0,0 +1,46 @@
+#!/usr/bin/env ruby
+#
+# ./chef-server - Serving up piping hot infrastructure!
+#
+# Author:: Adam Jacob (<adam@opscode.com>)
+# Copyright:: Copyright (c) 2008 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Based on the 'merb' command, by Ezra
+
+require "rubygems"
+require "merb-core"
+require "chef"
+
+if ARGV[0] && ARGV[0] =~ /^[^-]/
+ ARGV.push "-H"
+end
+unless %w[-a --adapter -i --irb-console -r --script-runner].any? { |o| ARGV.index(o) }
+ ARGV.push *%w[-a mongrel]
+end
+ARGV.push *[ "-I", File.join(File.dirname(__FILE__), "..", "lib", "init.rb") ]
+
+if index = ARGV.index("-C")
+ config = ARGV[index+1]
+ ARGV.delete("-C")
+ ARGV.delete(config)
+ Chef::Config.from_file(File.expand_path(config))
+else
+ Chef::Config.from_file(
+ File.join("/etc", "chef", "server.rb")
+ )
+end
+
+Merb.start
diff --git a/chef-server/lib/tasks/package.rake b/chef-server/lib/tasks/package.rake
index f5d70a65c1..9c654bceda 100644
--- a/chef-server/lib/tasks/package.rake
+++ b/chef-server/lib/tasks/package.rake
@@ -28,6 +28,7 @@ spec = Gem::Specification.new do |s|
s.bindir = "bin"
# s.executables = %w( chef-indexer chef-server )
+ s.executables = %w( chef-server )
# BUGBUG [cb] add LICENSE and README.txt
s.files = %w(Rakefile) + ["{app}/**/*",
diff --git a/chef/config/server.rb b/chef/config/server.rb
index 74c12df403..94d7292764 100644
--- a/chef/config/server.rb
+++ b/chef/config/server.rb
@@ -4,14 +4,11 @@
log_level :debug
cookbook_path File.join(File.dirname(__FILE__), "..", "examples", "config", "cookbooks")
-node_path File.join(File.dirname(__FILE__), "..", "examples", "config", "nodes")
file_store_path File.join(File.dirname(__FILE__), "..", "examples", "store")
openid_store_path File.join(File.dirname(__FILE__), "..", "examples", "openid-db")
openid_cstore_path File.join(File.dirname(__FILE__), "..", "examples", "openid-cstore")
-merb_log_path File.join(File.dirname(__FILE__), "..", "examples", "logs")
search_index_path File.join(File.dirname(__FILE__), "..", "examples", "search_index")
-
# openid_providers [ "localhost:4001", "openid.hjksolutions.com" ]
Chef::Log::Formatter.show_time = false