Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

feat: Pull edxapp translations via Atlas #7128

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions playbooks/roles/edxapp/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,22 @@
- install
- install:app-requirements

- name: "Pull translations using Atlas after Python dependencies installed"
shell: |
set -eu -o pipefail
source {{ edxapp_venv_dir }}/bin/activate
# Use production Django settings because otherwise debug_toolbar will be referenced and cause
# an error (we don't have developer Python deps installed.) Use minimal configs because the
# real configs aren't installed until later in the playbook.
DJANGO_SETTINGS_MODULE=lms.envs.production LMS_CFG=lms/envs/minimal.yml STUDIO_CFG=lms/envs/minimal.yml \
OPENEDX_ATLAS_PULL=true make pull_translations
Copy link
Contributor

@OmarIthawi OmarIthawi Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made some cosmetic suggestions here, but please do not accept it as-is. My Ansible skills are pretty rusty at the moment.

Suggested change
shell: |
set -eu -o pipefail
source {{ edxapp_venv_dir }}/bin/activate
# Use production Django settings because otherwise debug_toolbar will be referenced and cause
# an error (we don't have developer Python deps installed.) Use minimal configs because the
# real configs aren't installed until later in the playbook.
DJANGO_SETTINGS_MODULE=lms.envs.production LMS_CFG=lms/envs/minimal.yml STUDIO_CFG=lms/envs/minimal.yml \
OPENEDX_ATLAS_PULL=true make pull_translations
shell: |
set -eu -o pipefail
source {{ edxapp_venv_dir }}/bin/activate
make pull_translations
environment:
# Use production Django settings because otherwise debug_toolbar will be referenced and cause
# an error (we don't have developer Python deps installed.) Use minimal configs because the
# real configs aren't installed until later in the playbook.
EDX_PLATFORM_SETTINGS: "production"
LMS_CFG: "lms/envs/minimal.yml"
STUDIO_CFG: "lms/envs/minimal.yml"
OPENEDX_ATLAS_PULL: "true"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, I didn't know Ansible had environment as a field on tasks in general! Also, I can get rid of the set -eu -o pipefail since I no longer have a complicated shell script; the relevant command is the last one.

I'll give EDX_PLATFORM_SETTINGS a shot as well.

args:
executable: /usr/bin/bash
chdir: "{{ edxapp_code_dir }}"
become_user: "{{ edxapp_user }}"
tags:
- install

# If using CAS and you have a function for mapping attributes, install
# the module here. The next few tasks set up the python code sandbox
- name: install CAS attribute module
Expand Down
Loading