It is no longer necessary to run "make assets" manually

Instead, assets are copied to nginx automatically on run.
This commit is contained in:
Régis Behmo 2019-01-15 09:29:27 +01:00
parent f8a401cab9
commit 772e8257c3
6 changed files with 9 additions and 27 deletions

View File

@ -38,8 +38,7 @@ travis:
cd build && make build
cd deploy/local \
&& make configure SILENT=1 CONFIGURE_OPTS="-e SETTING_ACTIVATE_NOTES=1 -e SETTING_ACTIVATE_XQUEUE=1" \
&& make databases \
&& make assets
&& make databases
upgrade-to-tutor: ## Upgrade from earlier versions of tutor
@(stat config/config.json > /dev/null 2>&1 && (\

View File

@ -23,7 +23,6 @@ all: env ## Configure and run a full-featured platform
@$(MAKE) https-certificate
@$(MAKE) update
@$(MAKE) databases
@$(MAKE) assets
@$(MAKE) daemonize
@echo "All set \o/ You can access the LMS at http://localhost and the CMS at http://studio.localhost"
@ -92,11 +91,8 @@ reindex-courses: ## Refresh course index so they can be found in the LMS search
# settings. Thus, each step must be performed separately. This should be fixed
# in the next edx-platform release thanks to https://github.com/edx/edx-platform/pull/18430/
assets: ## Generate production-ready static assets
docker-compose -f scripts.yml run --rm \
--volume=$(PWD)/../../data/openedx:/tmp/openedx/ openedx bash -c \
"rm -rf /tmp/openedx/staticfiles \
&& cp -r /openedx/staticfiles /tmp/openedx"
assets: ## Copy production-ready static assets. Note that you should not have to run this command yourself: all assets should be sent to nginx on boot.
docker-compose run --rm openedx-assets
assets-development: ## Generate static assets for local development
$(DOCKER_COMPOSE_RUN_OPENEDX) --no-deps lms bash -c "openedx-assets build --env=dev"
assets-development-lms:

View File

@ -1,6 +0,0 @@
version: "3"
services:
# Useful for running one-off scripts
openedx:
image: ${OPENEDX_DOCKER_IMAGE:-regis/openedx:hawthorn}

View File

@ -37,6 +37,12 @@ services:
volumes:
- ../../data/elasticsearch:/usr/share/elasticsearch/data
openedx-assets:
image: ${OPENEDX_DOCKER_IMAGE:-regis/openedx:hawthorn}
volumes:
- ../../data/openedx:/var/www/openedx
command: bash -c "rm -rf /var/www/openedx/staticfiles && cp -r /openedx/staticfiles/ /var/www/openedx/"
nginx:
image: nginx:1.13
restart: unless-stopped

View File

@ -37,10 +37,6 @@ Then you must rebuild the openedx Docker image::
make build-openedx
Make sure the assets can be served by the web server::
make assets
Finally, follow the `Open edX documentation to enable your themes <https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/changing_appearance/theming/enable_themes.html#apply-a-theme-to-a-site>`_.
Extra xblocks and requirements

View File

@ -43,15 +43,6 @@ This command should be run just once. It will create the required databases tabl
If migrations are stopped with a ``Killed`` message, this certainly means the docker containers don't have enough RAM. See the :ref:`troubleshooting` section.
Collecting static assets
------------------------
::
make assets
This command also needs to be run just once. It will make sure that static assets, such as images, stylesheets and Javascript dependencies, can be served by the nginx container.
Running Open edX
----------------