[BB-5611] Setup support for static files and static pages
Description
This MR adds the capability to configure the following to instances being provisioned by Grove:
- Static files such as logo, favicon, banner cover images, etc.
- 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:
- 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:
- Change the project ref in your cluster repo to
kaustav/static_pages_files
- Checkout the
kaustav/static_pages_files
branch for the grove sub-repo in your cluster repo. - 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:
- Check this deployed pipeline
- Check the corresponding trigger payload on the right hand panel
- Check the instance config files
- Check the deployed instance
- Verify OpenCraft's logo in header and footer as well as favicon
- Verify custom banner image
- Verify custom banner text
- Verify custom text in About and Donate pages
Dependencies
Accompanying MRs:
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