Skip to content

Commit

Permalink
fixup! feat: add atlas pull for the communications app
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarIthawi committed Oct 12, 2023
1 parent ce0ee3f commit 0d47b04
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
12 changes: 9 additions & 3 deletions tutormfe/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,18 @@ def gh_refs_path() -> str:
"port": 1997,
},
"communications": {
"repository": "https://github.com/openedx/frontend-app-communications",
"refs": "https://api.github.com/repos/openedx/frontend-app-communications/git/refs/" + 'heads',
"repository": "https://github.com/Zeit-Labs/frontend-app-communications",
"refs": "https://api.github.com/repos/Zeit-Labs/frontend-app-communications/git/refs/heads",
"port": 1984,
"version": "master",
"version": "atlas-palm",
"atlas_pull": True,
},

# "communications": {
# "repository": "https://github.com/openedx/frontend-app-communications",
# "refs": "https://api.github.com/repos/openedx/frontend-app-communications/git/refs/" + gh_refs_path(),
# "port": 1984,
# },
"course-authoring": {
"repository": "https://github.com/openedx/frontend-app-course-authoring",
"refs": "https://api.github.com/repos/openedx/frontend-app-course-authoring/git/refs/" + gh_refs_path(),
Expand Down
18 changes: 8 additions & 10 deletions tutormfe/templates/mfe/build/mfe/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt update \

RUN mkdir -p /openedx/app /openedx/env
WORKDIR /openedx/app
ENV PATH ./node_modules/.bin:${PATH}
ENV PATH /openedx/app/node_modules/.bin:${PATH}

######## i18n strings
FROM base AS i18n
Expand Down Expand Up @@ -47,15 +47,6 @@ COPY --from={{ app_name }}-git /openedx/app /
######## {{ app_name }} (i18n)
FROM base AS {{ app_name }}-i18n
COPY --from={{ app_name }}-src / /openedx/app
{% if app.get("atlas_pull") %}
RUN npm install --no-save "@edx/frontend-platform" "@edx/openedx-atlas@~0" # TODO: Move that to a better place
ENV PATH /openedx/app/node_modules/.bin:${PATH}
# transifex_langs="" means all languages
RUN make OPENEDX_ATLAS_PULL=true transifex_langs="" pull_translations

# Uncomment to print debug messages
# RUN ls -R /openedx/app/src/i18n/; cat /openedx/app/src/i18n/index.js; exit 1
{% endif %}
COPY --from=i18n /openedx/i18n/{{ app_name }} /openedx/i18n/{{ app_name }}
COPY --from=i18n /openedx/i18n/i18n-merge.js /openedx/i18n/i18n-merge.js
RUN stat /openedx/app/src/i18n/messages 2> /dev/null || (echo "missing messages folder" && mkdir -p /openedx/app/src/i18n/messages)
Expand All @@ -77,6 +68,12 @@ RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/root/.npm,sharing=s
{{ patch("mfe-dockerfile-post-npm-install-{}".format(app_name)) }}
COPY --from={{ app_name }}-src / /openedx/app
COPY --from={{ app_name }}-i18n /openedx/app/src/i18n/messages /openedx/app/src/i18n/messages

{% if app.get("atlas_pull") %}
RUN npm install --no-save "@edx/frontend-platform" "@edx/openedx-atlas@~0" # TODO: Move that to a better place
RUN make OPENEDX_ATLAS_PULL=true transifex_langs="" pull_translations
{% endif %}

EXPOSE {{ app['port'] }}

# Configuration needed at build time
Expand Down Expand Up @@ -112,4 +109,5 @@ RUN mkdir -p /openedx/dist
# Copy static assets
{% for app_name, app in iter_mfes() %}
COPY --from={{ app_name }}-prod /openedx/app/dist /openedx/dist/{{ app_name }}
COPY --from={{ app_name }}-prod /openedx/app /openedx/{{ app_name }}-source
{% endfor %}

0 comments on commit 0d47b04

Please sign in to comment.