Commit a08fe9fb by Andy Armstrong

Merge pull request #9059 from edx/andya/faster-update-assets

Don't package or optimize assets on devstack
parents ee7d47c7 fb19d328
...@@ -277,13 +277,6 @@ XQUEUE_INTERFACE = { ...@@ -277,13 +277,6 @@ XQUEUE_INTERFACE = {
simplefilter('ignore') simplefilter('ignore')
################################# Middleware ################################### ################################# Middleware ###################################
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
# List of callables that know how to import templates from various sources. # List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = ( TEMPLATE_LOADERS = (
...@@ -460,9 +453,23 @@ MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage' ...@@ -460,9 +453,23 @@ MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
##### EMBARGO ##### ##### EMBARGO #####
EMBARGO_SITE_REDIRECT_URL = None EMBARGO_SITE_REDIRECT_URL = None
############################### Pipeline ####################################### ############################### PIPELINE #######################################
# Process static files using RequireJS Optimizer
STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage' STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage'
# List of finder classes that know how to find static files in various locations.
# Note: the pipeline finder is included to be able to discover optimized files
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
]
# Don't use compression by default
PIPELINE_CSS_COMPRESSOR = None
PIPELINE_JS_COMPRESSOR = None
from openedx.core.lib.rooted_paths import rooted_glob from openedx.core.lib.rooted_paths import rooted_glob
PIPELINE_CSS = { PIPELINE_CSS = {
...@@ -550,7 +557,9 @@ PIPELINE_JS_COMPRESSOR = None ...@@ -550,7 +557,9 @@ PIPELINE_JS_COMPRESSOR = None
STATICFILES_IGNORE_PATTERNS = ( STATICFILES_IGNORE_PATTERNS = (
"*.py", "*.py",
"*.pyc", "*.pyc",
# it would be nice if we could do, for example, "**/*.scss", "*.html",
# It would be nice if we could do, for example, "**/*.scss",
# but these strings get passed down to the `fnmatch` module, # but these strings get passed down to the `fnmatch` module,
# which doesn't support that. :( # which doesn't support that. :(
# http://docs.python.org/2/library/fnmatch.html # http://docs.python.org/2/library/fnmatch.html
...@@ -563,6 +572,10 @@ STATICFILES_IGNORE_PATTERNS = ( ...@@ -563,6 +572,10 @@ STATICFILES_IGNORE_PATTERNS = (
"coffee/*/*/*.coffee", "coffee/*/*/*.coffee",
"coffee/*/*/*/*.coffee", "coffee/*/*/*/*.coffee",
# Ignore tests
"spec",
"spec_helpers",
# Symlinks used by js-test-tool # Symlinks used by js-test-tool
"xmodule_js", "xmodule_js",
"common_static", "common_static",
......
...@@ -33,8 +33,14 @@ FEATURES['PREVIEW_LMS_BASE'] = "preview." + LMS_BASE ...@@ -33,8 +33,14 @@ FEATURES['PREVIEW_LMS_BASE'] = "preview." + LMS_BASE
########################### PIPELINE ################################# ########################### PIPELINE #################################
# Skip RequireJS optimizer in development # Skip packaging and optimization in development
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage'
# Revert to the default set of finders as we don't want the production pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
]
############################# ADVANCED COMPONENTS ############################# ############################# ADVANCED COMPONENTS #############################
......
...@@ -20,7 +20,17 @@ DATABASES = { ...@@ -20,7 +20,17 @@ DATABASES = {
}, },
} }
######################### Static file overrides ####################################
######################### PIPELINE ####################################
# Use RequireJS optimized storage
STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage'
# Revert to the default set of finders as we don't want to dynamically pick up files from the pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
]
# Redirect to the test_root folder within the repo # Redirect to the test_root folder within the repo
TEST_ROOT = REPO_ROOT / "test_root" TEST_ROOT = REPO_ROOT / "test_root"
...@@ -33,4 +43,3 @@ STATIC_ROOT = (TEST_ROOT / "staticfiles" / "cms").abspath() ...@@ -33,4 +43,3 @@ STATIC_ROOT = (TEST_ROOT / "staticfiles" / "cms").abspath()
# 1. Uglify is by far the slowest part of the build process # 1. Uglify is by far the slowest part of the build process
# 2. Having full source code makes debugging tests easier for developers # 2. Having full source code makes debugging tests easier for developers
os.environ['REQUIRE_BUILD_PROFILE_OPTIMIZE'] = 'none' os.environ['REQUIRE_BUILD_PROFILE_OPTIMIZE'] = 'none'
PIPELINE_JS_COMPRESSOR = None
...@@ -1118,13 +1118,6 @@ CREDIT_NOTIFICATION_CACHE_TIMEOUT = 5 * 60 * 60 ...@@ -1118,13 +1118,6 @@ CREDIT_NOTIFICATION_CACHE_TIMEOUT = 5 * 60 * 60
simplefilter('ignore') simplefilter('ignore')
################################# Middleware ################################### ################################# Middleware ###################################
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
# List of callables that know how to import templates from various sources. # List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = ( TEMPLATE_LOADERS = (
...@@ -1212,10 +1205,32 @@ MIDDLEWARE_CLASSES = ( ...@@ -1212,10 +1205,32 @@ MIDDLEWARE_CLASSES = (
# Clickjacking protection can be enabled by setting this to 'DENY' # Clickjacking protection can be enabled by setting this to 'DENY'
X_FRAME_OPTIONS = 'ALLOW' X_FRAME_OPTIONS = 'ALLOW'
############################### Pipeline ####################################### ############################### PIPELINE #######################################
# Process static files using RequireJS Optimizer
STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage' STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage'
# List of finder classes that know how to find static files in various locations.
# Note: the pipeline finder is included to be able to discover optimized files
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
]
# Don't use compression by default
PIPELINE_CSS_COMPRESSOR = None
PIPELINE_JS_COMPRESSOR = None
# Setting that will only affect the edX version of django-pipeline until our changes are merged upstream
PIPELINE_COMPILE_INPLACE = True
# Don't wrap JavaScript as there is code that depends upon updating the global namespace
PIPELINE_DISABLE_WRAPPER = True
# Specify the UglifyJS binary to use
PIPELINE_UGLIFYJS_BINARY = 'node_modules/.bin/uglifyjs'
from openedx.core.lib.rooted_paths import rooted_glob from openedx.core.lib.rooted_paths import rooted_glob
courseware_js = ( courseware_js = (
...@@ -1584,8 +1599,6 @@ PIPELINE_JS = { ...@@ -1584,8 +1599,6 @@ PIPELINE_JS = {
} }
} }
PIPELINE_DISABLE_WRAPPER = True
# Compile all coffee files in course data directories if they are out of date. # Compile all coffee files in course data directories if they are out of date.
# TODO: Remove this once we move data into Mongo. This is only temporary while # TODO: Remove this once we move data into Mongo. This is only temporary while
# course data directories are still in use. # course data directories are still in use.
...@@ -1606,25 +1619,32 @@ if os.path.isdir(DATA_DIR): ...@@ -1606,25 +1619,32 @@ if os.path.isdir(DATA_DIR):
os.system("coffee -c %s" % (js_dir / filename)) os.system("coffee -c %s" % (js_dir / filename))
PIPELINE_CSS_COMPRESSOR = None
PIPELINE_JS_COMPRESSOR = "pipeline.compressors.uglifyjs.UglifyJSCompressor"
STATICFILES_IGNORE_PATTERNS = ( STATICFILES_IGNORE_PATTERNS = (
"sass/*", "*.py",
"*.pyc",
"*.html",
# It would be nice if we could do, for example, "**/*.scss",
# but these strings get passed down to the `fnmatch` module,
# which doesn't support that. :(
# http://docs.python.org/2/library/fnmatch.html
"sass/*.scss",
"sass/*/*.scss",
"sass/*/*/*.scss",
"sass/*/*/*/*.scss",
"coffee/*.coffee", "coffee/*.coffee",
"coffee/*/*.coffee", "coffee/*/*.coffee",
"coffee/*/*/*.coffee", "coffee/*/*/*.coffee",
"coffee/*/*/*/*.coffee", "coffee/*/*/*/*.coffee",
# Ignore tests
"spec",
"spec_helpers",
# Symlinks used by js-test-tool # Symlinks used by js-test-tool
"xmodule_js", "xmodule_js",
) )
PIPELINE_UGLIFYJS_BINARY = 'node_modules/.bin/uglifyjs'
# Setting that will only affect the edX version of django-pipeline until our changes are merged upstream
PIPELINE_COMPILE_INPLACE = True
################################# DJANGO-REQUIRE ############################### ################################# DJANGO-REQUIRE ###############################
......
...@@ -85,8 +85,17 @@ def should_show_debug_toolbar(_): ...@@ -85,8 +85,17 @@ def should_show_debug_toolbar(_):
########################### PIPELINE ################################# ########################### PIPELINE #################################
# # Skip RequireJS optimizer in development # Skip packaging and optimization in development
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage'
# Revert to the default set of finders as we don't want the production pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
]
# Disable JavaScript compression in development
PIPELINE_JS_COMPRESSOR = None
# Whether to run django-require in debug mode. # Whether to run django-require in debug mode.
REQUIRE_DEBUG = DEBUG REQUIRE_DEBUG = DEBUG
......
...@@ -32,7 +32,16 @@ XQUEUE_INTERFACE = { ...@@ -32,7 +32,16 @@ XQUEUE_INTERFACE = {
} }
######################### Static file overrides #################################### ######################### PIPELINE ####################################
# Use RequireJS optimized storage
STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage'
# Revert to the default set of finders as we don't want to dynamically pick up files from the pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
]
# Redirect to the test_root folder within the repo # Redirect to the test_root folder within the repo
TEST_ROOT = REPO_ROOT / "test_root" TEST_ROOT = REPO_ROOT / "test_root"
...@@ -45,4 +54,3 @@ STATIC_ROOT = (TEST_ROOT / "staticfiles" / "lms").abspath() ...@@ -45,4 +54,3 @@ STATIC_ROOT = (TEST_ROOT / "staticfiles" / "lms").abspath()
# 1. Uglify is by far the slowest part of the build process # 1. Uglify is by far the slowest part of the build process
# 2. Having full source code makes debugging tests easier for developers # 2. Having full source code makes debugging tests easier for developers
os.environ['REQUIRE_BUILD_PROFILE_OPTIMIZE'] = 'none' os.environ['REQUIRE_BUILD_PROFILE_OPTIMIZE'] = 'none'
PIPELINE_JS_COMPRESSOR = None
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment