From 35fb5fa47ed3817e9dd6cfea7adaf173d08c15da Mon Sep 17 00:00:00 2001 From: Nate Hardison Date: Sun, 2 Jun 2013 15:34:00 -0700 Subject: [PATCH] Add wrapper task to start LMS/CMS server The LMS/CMS server startup depends on the :assets task, which needs to receive :system and :env arguments. Since the existing server startup tasks didn't take a :system argument, a new command called :runserver is created that does take :system, :env, and :options arguments. The old server startup tasks are adjusted to wrap the one :runserver task that does all of the heavy lifting. --- rakefiles/django.rake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rakefiles/django.rake b/rakefiles/django.rake index 8b42192130..910d4e39cc 100644 --- a/rakefiles/django.rake +++ b/rakefiles/django.rake @@ -15,14 +15,22 @@ task :fastlms do sh("#{django_admin} runserver --traceback --settings=lms.envs.dev --pythonpath=.") end +# Start :system locally with the specified :env and :options. +# +# This task should be invoked via the wrapper below, so we don't +# include a description to keep it from showing up in rake -T. +task :runserver, [:system, :env, :options] => [:install_prereqs, 'assets:_watch', :predjango] do |t, args| + sh(django_admin(args.system, args.env, 'runserver', args.options)) +end + [:lms, :cms].each do |system| desc <<-desc Start the #{system} locally with the specified environment (defaults to dev). Other useful environments are devplus (for dev testing with a real local database) desc - task system, [:env, :options] => [:install_prereqs, 'assets:_watch', :predjango] do |t, args| + task system, [:env, :options] do |t, args| args.with_defaults(:env => 'dev', :options => default_options[system]) - sh(django_admin(system, args.env, 'runserver', args.options)) + task(:runserver).invoke(system, args.env, args.options) end desc "Start #{system} Celery worker"