From fc56aa4e85875abd431fe19e59d1a2c123ed2a6d Mon Sep 17 00:00:00 2001 From: Julien Maupetit Date: Tue, 4 Sep 2018 11:29:39 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=A5(edxapp)=20remove=20legacy=20ed?= =?UTF-8?q?xapp=5Fsql=5Fdump=5Furl=20var?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow up of the hawthorn upgrade (see c52ed36), loading an SQL dump is no longer required, hence this legacy variable should be removed. --- apps/edxapp/vars/all/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/edxapp/vars/all/main.yml b/apps/edxapp/vars/all/main.yml index e1251863d..10a4a8eb0 100644 --- a/apps/edxapp/vars/all/main.yml +++ b/apps/edxapp/vars/all/main.yml @@ -8,7 +8,6 @@ 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 -edxapp_sql_dump_url: "https://gist.github.com/jmaupetit/1f9d270d7d2106774fd94ba89a51ab78/raw/b0004f2825623d03de58710bf936db175e96bc90/edx-database-ginko.sql" # -- memcached edxapp_memcached_image_name: memcached From e273e69928625083eb328f37acdfbe495baa1f98 Mon Sep 17 00:00:00 2001 From: Julien Maupetit Date: Tue, 4 Sep 2018 15:44:29 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8(edxapp)=20add=20support=20for=20L?= =?UTF-8?q?MS=20themes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- apps/edxapp/templates/lms/bc.yml.j2 | 12 +++++++++++- apps/edxapp/vars/all/main.yml | 8 ++++++++ .../development/configs/edxapp/lms/settings.yml.j2 | 3 +++ group_vars/customer/patient0/development/main.yml | 4 ++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/apps/edxapp/templates/lms/bc.yml.j2 b/apps/edxapp/templates/lms/bc.yml.j2 index 4139bca92..245404ebb 100644 --- a/apps/edxapp/templates/lms/bc.yml.j2 +++ b/apps/edxapp/templates/lms/bc.yml.j2 @@ -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: diff --git a/apps/edxapp/vars/all/main.yml b/apps/edxapp/vars/all/main.yml index 10a4a8eb0..2672b6059 100644 --- a/apps/edxapp/vars/all/main.yml +++ b/apps/edxapp/vars/all/main.yml @@ -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 diff --git a/group_vars/customer/patient0/development/configs/edxapp/lms/settings.yml.j2 b/group_vars/customer/patient0/development/configs/edxapp/lms/settings.yml.j2 index f67f38103..9352321d4 100644 --- a/group_vars/customer/patient0/development/configs/edxapp/lms/settings.yml.j2 +++ b/group_vars/customer/patient0/development/configs/edxapp/lms/settings.yml.j2 @@ -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" diff --git a/group_vars/customer/patient0/development/main.yml b/group_vars/customer/patient0/development/main.yml index 7d319772d..e544d04c7 100644 --- a/group_vars/customer/patient0/development/main.yml +++ b/group_vars/customer/patient0/development/main.yml @@ -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"