Skip to content

Commit

Permalink
feat: add atlas pull support (#4051)
Browse files Browse the repository at this point in the history
Refs: FC-0012 OEP-58
  • Loading branch information
shadinaif authored Dec 7, 2023
1 parent 700cc13 commit e5b4f29
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ FROM ubuntu:focal as app
ENV DEBIAN_FRONTEND noninteractive
# System requirements.
RUN apt update && \
apt-get install -qy \
apt-get install -qy \
curl \
gettext \
git \
language-pack-en \
build-essential \
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ compile_translations: requirements.tox
fake_translations: extract_translations dummy_translations compile_translations

pull_translations:
ifeq ($(OPENEDX_ATLAS_PULL),)
cd ecommerce && tx pull -a -f -t --mode reviewed
else
find ecommerce/conf/locale -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;
atlas pull $(OPENEDX_ATLAS_ARGS) translations/ecommerce/ecommerce/conf/locale:ecommerce/conf/locale
python manage.py compilemessages
endif

push_translations:
cd ecommerce && tx push -s
Expand Down
1 change: 1 addition & 0 deletions ecommerce/conf/locale/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,6 @@ ignore_dirs:
- i18n
- assets
- node_modules
- tests
- static/bower_components
- static/build
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ markdown==2.6.9
mysqlclient<1.5
newrelic
ndg-httpsclient
openedx-atlas
path.py==7.2
paypalrestsdk
premailer==2.9.2
Expand Down
2 changes: 2 additions & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ oauthlib==3.2.2
# getsmarter-api-clients
# requests-oauthlib
# social-auth-core
openedx-atlas==0.5.0
# via -r requirements/base.in
packaging==23.1
# via drf-yasg
paramiko==3.2.0
Expand Down
4 changes: 3 additions & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ edx-drf-extensions==9.0.0
# edx-rbac
edx-ecommerce-worker==3.3.4
# via -r requirements/test.txt
edx-i18n-tools==0.9.2
edx-i18n-tools==1.3.0
# via -r requirements/test.txt
edx-opaque-keys==2.3.0
# via
Expand Down Expand Up @@ -570,6 +570,8 @@ oauthlib==3.2.2
# getsmarter-api-clients
# requests-oauthlib
# social-auth-core
openedx-atlas==0.5.0
# via -r requirements/base.in
packaging==23.1
# via
# -r requirements/docs.txt
Expand Down
2 changes: 2 additions & 0 deletions requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ oauthlib==3.2.2
# getsmarter-api-clients
# requests-oauthlib
# social-auth-core
openedx-atlas==0.5.0
# via -r requirements/base.in
packaging==23.1
# via drf-yasg
paramiko==3.2.0
Expand Down
4 changes: 3 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ edx-drf-extensions==9.0.0
# edx-rbac
edx-ecommerce-worker==3.3.4
# via -r requirements/base.txt
edx-i18n-tools==0.9.2
edx-i18n-tools==1.3.0
# via -r requirements/test.in
edx-opaque-keys==2.3.0
# via
Expand Down Expand Up @@ -549,6 +549,8 @@ oauthlib==3.2.2
# getsmarter-api-clients
# requests-oauthlib
# social-auth-core
openedx-atlas==0.5.0
# via -r requirements/base.in
packaging==23.1
# via
# -r requirements/base.txt
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ setenv =
tests: DJANGO_SETTINGS_MODULE = ecommerce.settings.test
acceptance: DJANGO_SETTINGS_MODULE = ecommerce.settings.test
check_keywords: DJANGO_SETTINGS_MODULE = ecommerce.settings.test
extract_translations: DJANGO_SETTINGS_MODULE=
BOKCHOY_HEADLESS = true
NODE_BIN = ./node_modules/.bin
PATH=$PATH:$NODE_BIN
Expand All @@ -51,7 +52,7 @@ deps =
allowlist_externals =
/bin/bash
changedir =
dummy_translations,compile_translations,detect_changed_translations,validate_translations: ecommerce
extract_translations,dummy_translations,compile_translations,detect_changed_translations,validate_translations: ecommerce
commands =
static: python manage.py collectstatic --noinput --verbosity 0
static: python manage.py compress --force
Expand All @@ -64,8 +65,7 @@ commands =

pylint: pylint -j 0 --rcfile=pylintrc ecommerce e2e

extract_translations: python manage.py makemessages -l en -v1 -d django --ignore="docs/*" --ignore="src/*" --ignore="i18n/*" --ignore="assets/*" --ignore="node_modules/*" --ignore="ecommerce/static/bower_components/*" --ignore="ecommerce/static/build/*"
extract_translations: python manage.py makemessages -l en -v1 -d djangojs --ignore="docs/*" --ignore="src/*" --ignore="i18n/*" --ignore="assets/*" --ignore="node_modules/*" --ignore="ecommerce/static/bower_components/*" --ignore="ecommerce/static/build/*"
extract_translations: i18n_tool extract --no-segment

dummy_translations: i18n_tool dummy
compile_translations: python ../manage.py compilemessages
Expand Down

0 comments on commit e5b4f29

Please sign in to comment.