diff --git a/cms/startup.py b/cms/startup.py deleted file mode 100644 index 13225f4a4942..000000000000 --- a/cms/startup.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -Module with code executed during Studio startup -""" -from django.conf import settings - -# Force settings to run so that the python path is modified -settings.INSTALLED_APPS # pylint: disable=W0104 - -from django_startup import autostartup - - -def run(): - """ - Executed during django startup - """ - autostartup() diff --git a/cms/startup.py b/cms/startup.py new file mode 120000 index 000000000000..5d0a9f8df340 --- /dev/null +++ b/cms/startup.py @@ -0,0 +1 @@ +../lms/startup.py \ No newline at end of file diff --git a/rakefile b/rakefile index 2cf442bca9fc..1dc47e76e026 100644 --- a/rakefile +++ b/rakefile @@ -15,6 +15,18 @@ REPORT_DIR = File.join(REPO_ROOT, "reports") # Environment constants SERVICE_VARIANT = ENV['SERVICE_VARIANT'] +# if service variant, honor that; +# - if not, pass the correct ENV tokens for lms or cms +if not SERVICE_VARIANT + # ignore command line environments, e.g. "rake e1=this" + clean_args = ARGV.delete_if { |x| /=/.match(x) } + # consider only the words remaining (parse out separators); + clean_args = clean_args.join(' ').split(/\W/) + # if lms or cms is among command line words, use it's env: + SERVICE_VARIANT = clean_args.include?('lms') ? "lms" : + (clean_args.include?('studio') or clean_args.include?('cms')) ? "cms" : + SERVICE_VARIANT +end CONFIG_PREFIX = SERVICE_VARIANT ? SERVICE_VARIANT + "." : "" ENV_FILE = File.join(ENV_ROOT, CONFIG_PREFIX + "env.json") ENV_TOKENS = File.exists?(ENV_FILE) ? JSON.parse(File.read(ENV_FILE)) : {} diff --git a/rakelib/assets.rake b/rakelib/assets.rake index 98a4f7ba5431..bcd12e3d7385 100644 --- a/rakelib/assets.rake +++ b/rakelib/assets.rake @@ -1,4 +1,5 @@ # Theming constants + USE_CUSTOM_THEME = ENV_TOKENS.has_key?('FEATURES') && ENV_TOKENS['FEATURES']['USE_CUSTOM_THEME'] if USE_CUSTOM_THEME THEME_NAME = ENV_TOKENS['THEME_NAME'] @@ -23,17 +24,22 @@ def xmodule_cmd(watch=false, debug=false) end def coffee_cmd(watch=false, debug=false) + brew_paths = ["lms/", "cms/", "common/"] + if USE_CUSTOM_THEME + # put theme path first just to be safe; + brew_paths.unshift(THEME_ROOT) + end + if watch && Launchy::Application.new.host_os_family.darwin? available_files = Process::getrlimit(:NOFILE)[0] if available_files < MINIMAL_DARWIN_NOFILE_LIMIT Process.setrlimit(:NOFILE, MINIMAL_DARWIN_NOFILE_LIMIT) - end end if watch - "node_modules/.bin/coffee --compile --watch lms/ cms/ common/" + "node_modules/.bin/coffee --compile --watch #{brew_paths.join(' ')}" else - "node_modules/.bin/coffee --compile `find lms/ cms/ common/ -type f -name *.coffee` " + "node_modules/.bin/coffee --compile `find #{brew_paths.join(' ')} -type f -name *.coffee` " end end