Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion providers/celery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@
django_resource = new_resource.application.sub_resources.select{|res| res.type == :django}.first
raise "No Django deployment resource found" unless django_resource
command "#{::File.join(django_resource.virtualenv, "bin", "python")} manage.py #{cmd}"
environment new_resource.environment
else
command cmd
environment 'CELERY_CONFIG_MODULE' => new_resource.config
if new_resource.environment
environment new_resource.environment.merge({'CELERY_CONFIG_MODULE' => new_resource.config})
else
environment 'CELERY_CONFIG_MODULE' => new_resource.config
end
end
directory ::File.join(new_resource.path, "current")
autostart false
Expand Down
5 changes: 4 additions & 1 deletion providers/gunicorn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
gunicorn_install "gunicorn-#{new_resource.application.name}" do
virtualenv django_resource ? django_resource.virtualenv : new_resource.virtualenv
end

if !new_resource.restart_command
new_resource.restart_command do
run_context.resource_collection.find(:supervisor_service => new_resource.application.name).run_action(:restart)
Expand Down Expand Up @@ -72,6 +72,9 @@

supervisor_service new_resource.application.name do
action :enable
if new_resource.environment
environment new_resource.environment
end
if new_resource.app_module == :django
django_resource = new_resource.application.sub_resources.select{|res| res.type == :django}.first
raise "No Django deployment resource found" unless django_resource
Expand Down
1 change: 1 addition & 0 deletions resources/celery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
attribute :celerybeat, :kind_of => [TrueClass, FalseClass], :default => false
attribute :celerycam, :kind_of => [TrueClass, FalseClass], :default => false
attribute :camera_class, :kind_of => [String, NilClass], :default => nil
attribute :environment, :kind_of => [Hash], :default => {}

def config_base
config.split(/[\\\/]/).last
Expand Down
1 change: 1 addition & 0 deletions resources/gunicorn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@
attribute :virtualenv, :kind_of => String, :default => nil
attribute :packages, :kind_of => [Array, Hash], :default => []
attribute :requirements, :kind_of => [NilClass, String, FalseClass], :default => nil
attribute :environment, :kind_of => [Hash], :default => {}