Permalink
Browse files

[COOK-1188] - implement a reusable gunicorn_install lwrp

  • Loading branch information...
1 parent 02822e6 commit f7f1ca7e7aa17843ce9f3ce9b818f202b04cc2f9 @jtimberman jtimberman committed Apr 19, 2012
Showing with 58 additions and 0 deletions.
  1. +30 −0 providers/install.rb
  2. +28 −0 resources/install.rb
View
@@ -0,0 +1,30 @@
+#
+# Author:: Joshua Timberman <joshua@opscode.com>
+# Cookbook Name:: gunicorn
+# Provider:: install
+#
+# Copyright:: Copyright (c) 2012, Opscode, Inc <legal@opscode.com>
+# 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.
+
+action :install do
+ python_virtualenv new_resource.virtualenv do
+ action :create
+ end if new_resource.virtualenv
+
+ python_pip "gunicorn" do
+ virtualenv new_resource.virtualenv
+ action :install
+ end
+end
View
@@ -0,0 +1,28 @@
+#
+# Author:: Joshua Timberman <joshua@opscode.com>
+# Cookbook Name:: gunicorn
+# Resource:: install
+#
+# Copyright:: Copyright (c) 2012, Opscode, Inc <legal@opscode.com>
+# 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.
+#
+actions :install
+
+attribute :virtualenv, :kind_of => String, :default => nil
+
+def initialize(*args)
+ super
+ @action = :install
+end

0 comments on commit f7f1ca7

Please sign in to comment.