Skip to content

Commit

Permalink
feat: Enable per-MFE PARAGON_BRAND_PACKAGE for theme versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
mfarhan943 committed Nov 14, 2024
1 parent b1cc743 commit b2d1484
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-account'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-account"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand All @@ -722,6 +724,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-profile'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-profile"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand All @@ -737,6 +741,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-authn'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-authn"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand All @@ -752,6 +758,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-course-authoring'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-course-authoring"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand All @@ -767,6 +775,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-gradebook'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-gradebook"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand All @@ -782,6 +792,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-ora-grading'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-ora-grading"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand All @@ -797,6 +809,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-learner-dashboard'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-learner-dashboard"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand All @@ -812,6 +826,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-learner-record'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-learner-record"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand All @@ -827,6 +843,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-learning'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-learning"
environment:
PARAGON_BRAND_PACKAGE: '@edx/[email protected]'
networks:
default:
aliases:
Expand All @@ -842,6 +860,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-library-authoring'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-library-authoring"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand All @@ -858,6 +878,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-payment'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-payment"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand All @@ -873,6 +895,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-program-console'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-program-console"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand All @@ -889,6 +913,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-publisher'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-publisher"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
networks:
default:
aliases:
Expand Down
13 changes: 12 additions & 1 deletion microfrontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@ services:
#
# Fail fast if package install fails to avoid mysterious
# errors later.
command: bash -c 'npm ci || exit 1; if [ ! -z "$PARAGON_BRAND_PACKAGE" ]; then npx paragon install-theme "@$PARAGON_BRAND_PACKAGE" || exit 1; fi; while true; do npm start; sleep 2; done'
command:
- bash
- -c
- |
npm ci || exit 1
if [ -n "$(printenv PARAGON_BRAND_PACKAGE)" ]; then
npx paragon install-theme "$(printenv PARAGON_BRAND_PACKAGE)" || exit 1
fi
while true; do
npm start
sleep 2
done
stdin_open: true
tty: true
image: node:18
Expand Down
5 changes: 0 additions & 5 deletions options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,3 @@ credentials+cms+discovery+ecommerce+insights+lms+registrar
# Separated by plus signs. Listed in alphabetical order for clarity.
THIRD_PARTY_SERVICES ?= \
chrome+coursegraph+elasticsearch710+firefox+memcached+mongo+mysql57+mysql80+opensearch12+redis+namenode+datanode+resourcemanager+nodemanager+sparkmaster+sparkworker+vertica

# Set default theme for MFEs
ifndef PARAGON_BRAND_PACKAGE
PARAGON_BRAND_PACKAGE = edx/brand-edx.org
endif
2 changes: 1 addition & 1 deletion provision-set-edx-theme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sed -i '' "s|^# \"/edx/app/edxapp/edx-platform/themes/\"| \"/edx/app/edxa
sed -i '' "/COMPREHENSIVE_THEME_DIRS = \[/a\\
\"$THEME_DIR\",
" "$DEVSTACK_FILE"
sed -i '' "s|^# \]|]|" "$DEVSTACK_FILE" # Uncomment the closing bracket
sed -i '' "s|^# \]|]|" "$DEVSTACK_FILE"
sed -i '' "s|^# TEMPLATES\[1\]\[\"DIRS\"\] = _make_mako_template_dirs|TEMPLATES[1][\"DIRS\"] = _make_mako_template_dirs|" "$DEVSTACK_FILE"
sed -i '' "s|^# derive_settings(__name__)|derive_settings(__name__)|" "$DEVSTACK_FILE"

Expand Down

0 comments on commit b2d1484

Please sign in to comment.