eduNEXT / tutor-contrib-edunext-distro

A tool to facilitate the customization of an Openedx instance, adding commands and settings to have an easy-to-use and a ready-to-deploy in local or in development openedx distribution.
2 stars 1 forks source link

feat: distro allows themes changes DS-234 #36

Closed danielsgz closed 1 year ago

danielsgz commented 1 year ago

Setting a time used to be hard-coded, however, this new feature will set the default theme to the first one in the list set at the strain.yml file. In order to try this commit follow:

  1. Use the following strain.yml to create a new environment:
    
    STRAIN_NAME: nuez1
    STRAIN_TUTOR_VERSION: v14.1.0
    DEV_PROJECT_NAME: nuez_dev1
    LOCAL_PROJECT_NAME: nuez_local1
    CMS_HOST: studio.nuez.edunext.link
    LMS_HOST: lms.nuez.edunext.link
    PLATFORM_NAME: Distro nuez
    EDX_PLATFORM_REPOSITORY: https://github.com/eduNEXT/edunext-platform.git
    EDX_PLATFORM_VERSION: ednx-release/nuez.master
    DOCKER_IMAGE_OPENEDX: docker.io/ednxops/distro-edunext-edxapp:nuez-061220221
    DOCKER_IMAGE_OPENEDX_DEV: docker.io/ednxops/distro-edunext-edxapp-dev:nuez-061220221
    STRAIN_TUTOR_PLUGINS:
    - REPO: tutor-contrib-edunext-distro
    VERSION: dsg/distro-themes
    EGG: tutor-contrib-edunext-distro==v3.1.0
    PACKAGE_NAME: distro
    PROTOCOL: ssh
    STRAIN_EXTRA_COMMANDS:
    - APP: 'tutor'
    COMMAND: 'distro enable-themes'
    - APP: 'tutor'
    COMMAND: 'distro enable-private-packages'
    STRAIN_VOLUME_OVERRIDES:
    edxapp:
    - DESTINATION: ../../src/edxapp/edx-platform
      LOCATION: /openedx/edx-platform
    # Themes
    - DESTINATION: ../../src/themes/ednx-saas-themes
      LOCATION: /openedx/themes/ednx-saas-themes
    # Public eox
    - DESTINATION: ../../src/edxapp/eox-core
      LOCATION: /openedx/extra_deps/eox-core
    - DESTINATION: ../../src/edxapp/eox-tagging
      LOCATION: /openedx/extra_deps/eox-tagging
    - DESTINATION: ../../src/edxapp/eox-tenant
      LOCATION: /openedx/extra_deps/eox-tenant
    - DESTINATION: ../../src/edxapp/eox-hooks
      LOCATION: /openedx/extra_deps/eox-hooks
    - DESTINATION: ../../src/edxapp/eox-audit-model
      LOCATION: /openedx/extra_deps/eox-audit-model
    - DESTINATION: ../../src/edxapp/eox-theming
      LOCATION: /openedx/extra_deps/eox-theming
    STRAIN_EXPORT_VOLUMES:
    - CONTAINER: lms
    LOCATION: /openedx/edx-platform
    DESTINATION: src/edxapp/edx-platform
    # Themes
    - CONTAINER: lms
    LOCATION: /openedx/themes/ednx-saas-themes
    DESTINATION: src/themes/ednx-saas-themes
    # Public eox
    - CONTAINER: lms
    LOCATION: /openedx/extra_deps/eox-core
    DESTINATION: src/edxapp/eox-core
    - CONTAINER: lms
    LOCATION: /openedx/extra_deps/eox-tagging
    DESTINATION: src/edxapp/eox-tagging
    - CONTAINER: lms
    LOCATION: /openedx/extra_deps/eox-tenant
    DESTINATION: src/edxapp/eox-tenant
    - CONTAINER: lms
    LOCATION: /openedx/extra_deps/eox-hooks
    DESTINATION: src/edxapp/eox-hooks
    - CONTAINER: lms
    LOCATION: /openedx/extra_deps/eox-audit-model
    DESTINATION: src/edxapp/eox-audit-model
    - CONTAINER: lms
    LOCATION: /openedx/extra_deps/eox-theming
    DESTINATION: src/edxapp/eox-theming
    DISTRO_EOX_THEMING_DPKG:
    index: git
    name: eox-theming
    private: false
    repo: eox-theming
    domain: github.com
    path: eduNEXT
    protocol: https
    variables:
    development:
      GET_BRANDING_API: eox_tenant.edxapp_wrapper.backends.branding_api_l_v1
      EOX_THEMING_CONFIG_SOURCES: [
        "from_eox_tenant_microsite_v2",
        "from_django_settings"
      ]
    production:
      GET_BRANDING_API: eox_tenant.edxapp_wrapper.backends.branding_api_l_v1
      EOX_THEMING_CONFIG_SOURCES: [
        "from_eox_tenant_microsite_v2",
        "from_django_settings"
      ]
    version: v4.0.1
    DISTRO_THEMES_NAME:
    - bragi-00695c
    - bragi-29b6f6
    - bragi-66bb6a
    - bragi-ad1457
    - bragi-fb8c00
    - bragi-00838f
    - bragi-2e7d32
    - bragi-673ab7
    - bragi-c0ca33
    - bragi-fdd835
    - bragi-00897b
    - bragi-37474f
    - bragi-6a1b9a
    - bragi-c62828
    - bragi-ff5722
    - bragi-009688

2. Create a new project wiht: `stack strain create`
3. Turn on your env with: `source .tvm/bin/activate`
4. Run `stack strain dev configure` up to the third step **save config** or just run the save config command. 
5. Go to `env/apps/openedx/config/cms.env.yml` and look for the `DEFAULT_SITE_THEME: "<first-color-in-list>"`
6. Go to `env/apps/openedx/config/Lms.env.yml` and look for the `DEFAULT_SITE_THEME: "<first-color-in-list>"`

**Disclaimer**: If you used the same `strain.yml` at the first step it should be: `DEFAULT_SITE_THEME:  "bragi-00695c"`