Skip to content

Commit

Permalink
✨(edxapp) add support for LMS themes
Browse files Browse the repository at this point in the history
This work adapts @sampaccoud's work on #105 to add customizable themes
for the LMS. We've added an example for patient0/development with a
public theme cooked by the Racoongang team.
  • Loading branch information
jmaupetit committed Sep 4, 2018
1 parent fc56aa4 commit e273e69
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
12 changes: 11 additions & 1 deletion apps/edxapp/templates/lms/bc.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,19 @@ spec:
strategy:
type: Docker
source:
{% if edxapp_theme_url is defined and edxapp_theme_url -%}
git:
uri: "{{ edxapp_theme_url }}"
ref: "{{ edxapp_theme_tag | default("master") }}"
{% endif -%}
dockerfile: |-
FROM {{ edxapp_image_name }}:{{ edxapp_image_tag }}
# Add new statements here
USER 0
{% if edxapp_theme_url is defined and edxapp_theme_url -%}
COPY . /edx/app/edxapp/edx-platform/themes/custom-theme
RUN NO_PREREQ_INSTALL=1 paver update_assets --settings={{ edxapp_build_settings }} --skip-collect
{% endif -%}
USER 10000
triggers:
- type: "ConfigChange"
output:
Expand Down
8 changes: 8 additions & 0 deletions apps/edxapp/vars/all/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ edxapp_lms_host: "lms.{{ project_name}}.{{ domain_name }}"
edxapp_image_name: "fundocker/edxapp"
edxapp_image_tag: "hawthorn.1-1.0.0"
edxapp_django_port: 8000
# Customize edxapp's LMS theme: the url is supposed to point to the git
# repository and the tag to either a tag or a branch, e.g.:
#
# edxapp_theme_url: "https://github.com/raccoongang/themes_for_themex.io)"
# edxapp_theme_tag: "marvel-theme-ginkgo"
edxapp_theme_url: ""
edxapp_theme_tag: ""
edxapp_build_settings: "fun.docker_build_production"

# -- memcached
edxapp_memcached_image_name: memcached
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ HIGH_PRIORITY_QUEUE: "{{ edxapp_celery_lms_high_priority_queue }}"
DEFAULT_PRIORITY_QUEUE: "{{ edxapp_celery_lms_default_priority_queue }}"
LOW_PRIORITY_QUEUE: "{{ edxapp_celery_lms_low_priority_queue }}"
HIGH_MEM_QUEUE: "{{ edxapp_celery_lms_high_mem_queue }}"

# Use a custom theme
DEFAULT_SITE_THEME: "custom-theme"
4 changes: 4 additions & 0 deletions group_vars/customer/patient0/development/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ apps:
- group_vars/customer/patient0/development/configs/edxapp/lms/settings.yml.j2
- name: redis
- name: hello

# Install a custom theme for edxapp-lms
edxapp_theme_url: "https://github.com/raccoongang/themes_for_themex.io"
edxapp_theme_tag: "marvel-theme-ginkgo"

0 comments on commit e273e69

Please sign in to comment.