Skip to content

Commit

Permalink
feat: add atlas step to the build - FC-0012
Browse files Browse the repository at this point in the history
Adding the pull behind a feature flag until it's fully implemented

Refs: FC-0012 OEP-58
  • Loading branch information
shadinaif committed Dec 14, 2023
1 parent c5aef92 commit 09bc517
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions tutorecommerce/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"OAUTH2_KEY_SSO": "ecommerce-sso",
"OAUTH2_KEY_SSO_DEV": "ecommerce-sso-dev",
"WORKER_JWT_ISSUER": "ecommerce-worker", # TODO do we need to keep this?
"ATLAS_PULL": False,
},
"unique": {
"MYSQL_PASSWORD": "{{ 8|random_string }}",
Expand Down
11 changes: 9 additions & 2 deletions tutorecommerce/templates/ecommerce/build/ecommerce/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
###### Minimal image with base system requirements for most stages
FROM docker.io/ubuntu:20.04 as minimal

ENV DEBIAN_FRONTEND=noninteractive
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update && \
apt install -y curl git-core language-pack-en
apt install -y curl gettext git-core language-pack-en

###### Checkout code
FROM minimal as checkout

ARG ECOMMERCE_REPOSITORY=https://github.com/edx/ecommerce.git
ARG ECOMMERCE_REPOSITORY=https://github.com/openedx/ecommerce.git
ARG ECOMMERCE_VERSION='{{ OPENEDX_COMMON_VERSION }}'
RUN mkdir -p /openedx/ecommerce && \
git clone $ECOMMERCE_REPOSITORY --branch $ECOMMERCE_VERSION --depth 1 /openedx/ecommerce
Expand Down Expand Up @@ -79,6 +80,12 @@ RUN cd /openedx/requirements/ \
{% for extra_requirement in ECOMMERCE_EXTRA_PIP_REQUIREMENTS %}RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared,uid=${APP_USER_ID} pip install '{{ extra_requirement }}'
{% endfor %}

{% if ECOMMERCE_ATLAS_PULL %}
# Pull translations. Support the OEP-58 proposal behind a feature flag until it's fully implemented.
RUN atlas pull {{ patch("atlas-extra-args") }} translations/ecommerce/ecommerce/conf/locale:ecommerce/conf/locale
RUN python manage.py compilemessages
{% endif %}

{{ patch("ecommerce-dockerfile-pre-assets") }}

# Collect static assets (aka: "make static")
Expand Down

0 comments on commit 09bc517

Please sign in to comment.