Skip to content

[BB-5611] Setup support for static files and static pages

Kaustav Banerjee requested to merge kaustav/static_pages_files into main

Description

This MR adds the capability to configure the following to instances being provisioned by Grove:

  1. Static files such as logo, favicon, banner cover images, etc.
  2. Static page content such as About page, Donate page, Banner text, etc. using the site configuration feature and tutor-config-grove plugin

This MR also fixes the following:

  1. Theme-overrides: such as Footer background color, header background color, etc. using open-craft/edx-simple-theme

Supporting information

OpenCraft internal ticket : BB-5611

Testing instructions

Steps to test the changes:

A. To trigger a new deployment in your cluster:

  1. Change the project ref in your cluster repo to kaustav/static_pages_files
  2. Checkout the kaustav/static_pages_files branch for the grove sub-repo in your cluster repo.
  3. Trigger deployment through REST request and provide the theme overrides, static file urls, and site configs. Sample Request:
curl -X POST \
    -F token=<DEPLOYMENT_TOKEN> \
    -F "ref=main" \
    -F "variables[INSTANCE_NAME]=<INSTANCE_NAME>" \
    -F "variables[DEPLOYMENT_REQUEST_ID]=1" \
    -F "variables[TUTOR_CONTACT_EMAIL]=test@example.com" \
    -F "variables[NEW_INSTANCE_TRIGGER]=1" \
    -F "TUTOR_LMS_HOST=<LMS_HOST_NAME>" \
    -F "TUTOR_MFE_HOST=<MFE_HOST_NAME>" \
    -F "TUTOR_CMS_HOST=<STUDIO_HOST_NAME>" \
    -F "GROVE_SIMPLE_THEME_SCSS_OVERRIDES={\"DATA\": [{\"value\": \"#0075b4\",\"variable\": \"footer-bg\"},{\"value\": \"#2d1a3d\",\"variable\": \"header-bg\"},{\"value\": \"#3399ff\",\"variable\": \"link-color\"},{\"value\": \"#0075b4\",\"variable\": \"main-color\"},{\"value\": \"url(\\\"../images/hero_cover.png\\\")\",\"variable\": \"homepage-bg-image\"}]}" \
    -F "GROVE_SIMPLE_THEME_STATIC_FILES_URLS={\"DATA\":[{\"dest\":\"lms/static/images/logo.png\",\"url\":\"<LOGO_URL>\"},{\"dest\":\"lms/static/images/favicon.ico\",\"url\":\"<FAVICON_URL>\"},{\"dest\":\"lms/static/images/hero_cover.png\",\"url\":\"<BANNER_URL>\"}]}" \
    -F "TUTOR_SITE_CONFIG_JSON={\"version\": 0, \"homepage_overlay_html\": \"<h1>Welcome to The customized instance</h1><p>The static files in this instance is customized using Grove</p>\", \"static_template_about_content\": \"<p>This is my about page .. where we write about things</p>\", \"static_template_donate_content\": \"<p>Please Donate</p>\"}" \
    https://gitlab.com/api/v4/projects/34846746/trigger/pipeline

B. Verify existing deployment:

  1. Check this deployed pipeline
  2. Check the corresponding trigger payload on the right hand panel
  3. Check the instance config files
  4. Check the deployed instance
  5. Verify OpenCraft's logo in header and footer as well as favicon
  6. Verify custom banner image
  7. Verify custom banner text
  8. Verify custom text in About and Donate pages

Dependencies

Accompanying MRs:

  1. grove-template!21 (merged)
  2. tutor-contrib-grove!1 (merged)

Checklist

If any of the items below is not applicable, do not remove them, but put a check in it.

  • All providers include the new feature/change
  • All affected providers can provision new clusters
  • Unit tests are added/updated
  • Documentation is added/updated
  • The TOOLS_CONTAINER_IMAGE_VERSION in ci_vars.yml is updated
  • The grove-template repository is updated

Additional context

Add any other context about the merge request here.

Edited by Kaustav Banerjee

Merge request reports