forked from openedx-unsupported/devstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add enterprise-access to devstack
- Loading branch information
1 parent
3c79ad3
commit 3769273
Showing
10 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
set -euf -o pipefail | ||
|
||
. scripts/colors.sh | ||
|
||
name="enterprise-access" | ||
port="18270" | ||
|
||
docker-compose up -d $name | ||
|
||
# Run migrations | ||
echo -e "${GREEN}Running migrations for ${name}...${NC}" | ||
docker compose exec -T ${name} bash -e -c "cd /edx/app/enterprise-access/ && make migrate" -- "$name" | ||
# docker compose exec -T ${name} bash -e -c 'source /edx/app/credentials/credentials_env && cd /edx/app/credentials/credentials && make migrate' -- "$name" | ||
|
||
# Create superuser | ||
echo -e "${GREEN}Creating super-user for ${name}...${NC}" | ||
docker compose exec -T ${name} bash -e -c "echo 'from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser(\"edx\", \"[email protected]\", \"edx\") if not User.objects.filter(username=\"edx\").exists() else None' | python /edx/app/enterprise-access/manage.py shell" -- "$name" | ||
|
||
./provision-ida-user.sh ${name} ${name} ${port} | ||
|
||
# Create system wide enterprise role assignment | ||
# TODO: this is a pretty complex oneline, we should probably eventually convert this to a management command. | ||
echo -e "${GREEN}Creating system wide enterprise user role assignment for ${name}...${NC}" | ||
docker compose exec -T lms bash -e -c "source /edx/app/edxapp/edxapp_env && echo 'from django.contrib.auth import get_user_model; from enterprise.models import SystemWideEnterpriseUserRoleAssignment, SystemWideEnterpriseRole; User = get_user_model(); worker_user = User.objects.get(username=\"${name}_worker\"); operator_role = SystemWideEnterpriseRole.objects.get(name=\"enterprise_openedx_operator\"); assignment = SystemWideEnterpriseUserRoleAssignment.objects.get_or_create(user=worker_user, role=operator_role, applies_to_all_contexts=True);' | /edx/app/edxapp/venvs/edxapp/bin/python /edx/app/edxapp/edx-platform/manage.py lms shell" -- lms | ||
|
||
# Restart enterprise.catalog app and worker containers | ||
# docker-compose restart app | ||
make dev.restart-devserver.enterprise-access |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ xqueue \ | |
coursegraph \ | ||
insights \ | ||
analyticsapi \ | ||
enterprise-access \ | ||
" | ||
|
||
# What should we provision? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ repos=( | |
"https://github.com/openedx/frontend-app-publisher.git" | ||
"https://github.com/edx/edx-analytics-dashboard.git" | ||
"https://github.com/edx/edx-analytics-data-api.git" | ||
"https://github.com/openedx/enterprise-access.git" | ||
) | ||
|
||
non_release_repos=( | ||
|
@@ -66,6 +67,7 @@ ssh_repos=( | |
"[email protected]:openedx/frontend-app-publisher.git" | ||
"[email protected]:edx/edx-analytics-dashboard.git" | ||
"[email protected]:edx/edx-analytics-data-api.git" | ||
"[email protected]:openedx/enterprise-access.git" | ||
) | ||
|
||
non_release_ssh_repos=( | ||
|