diff --git a/docker-compose-host.yml b/docker-compose-host.yml index 2fef47a909..61a3a2ba38 100644 --- a/docker-compose-host.yml +++ b/docker-compose-host.yml @@ -77,7 +77,7 @@ services: enterprise-catalog-worker: volumes: - ${DEVSTACK_WORKSPACE}/enterprise-catalog:/edx/app/enterprise_catalog/enterprise_catalog - enterprise-catalog-curations_worker: + enterprise-catalog-curations-worker: volumes: - ${DEVSTACK_WORKSPACE}/enterprise-catalog:/edx/app/enterprise_catalog/enterprise_catalog # Note that frontends mount `src` to /edx/app/src instead of /edx/src. diff --git a/docker-compose.yml b/docker-compose.yml index 44c56d51c8..85dbf7f863 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -747,7 +747,7 @@ services: stdin_open: true tty: true - enterprise-catalog-curations_worker: + enterprise-catalog-curations-worker: image: edxops/enterprise-catalog-dev command: bash -c 'cd /edx/app/enterprise_catalog/enterprise_catalog && celery -A enterprise_catalog worker -Q enterprise_catalog.curations -l DEBUG' container_name: enterprise.catalog.curations @@ -986,4 +986,3 @@ volumes: mysql57_data: mysql80_data: redis_data: - enterprise_catalog_mysql8: diff --git a/provision-enterprise-catalog.sh b/provision-enterprise-catalog.sh new file mode 100755 index 0000000000..44500665ae --- /dev/null +++ b/provision-enterprise-catalog.sh @@ -0,0 +1,17 @@ +name="enterprise-catalog" +port="18160" + +docker compose up -d $name + +# Run migrations +echo -e "${GREEN}Running migrations for ${name}...${NC}" +docker compose exec -T ${name} bash -c "cd /edx/app/${name}/${name}/ && make migrate" + +# Create superuser +echo -e "${GREEN}Creating super-user for ${name}...${NC}" +docker compose exec -T ${name} bash -c "echo 'from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser(\"edx\", \"edx@example.com\", \"edx\") if not User.objects.filter(username=\"edx\").exists() else None' | python /edx/app/${name}/${name}/manage.py shell" + +./provision-ida-user.sh ${name} ${name} ${port} + +# Restart enterprise.catalog app and worker containers +docker-compose restart enterprise-catalog enterprise-catalog-worker diff --git a/provision-enterprise_catalog.sh b/provision-enterprise_catalog.sh deleted file mode 100755 index 59dfb85984..0000000000 --- a/provision-enterprise_catalog.sh +++ /dev/null @@ -1,23 +0,0 @@ -name="enterprise-catalog" -port="18160" - -docker compose up -d $name - -# Run migrations -echo -e "${GREEN}Running migrations for ${name}...${NC}" -docker exec -t enterprise.catalog.app bash -c "cd /edx/app/${name}/${name}/ && make migrate" - -# Create superuser -echo -e "${GREEN}Creating super-user for ${name}...${NC}" -docker exec -t enterprise.catalog.app bash -c "echo 'from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser(\"edx\", \"edx@example.com\", \"edx\") if not User.objects.filter(username=\"edx\").exists() else None' | python /edx/app/${name}/${name}/manage.py shell" - -# Provision IDA User in LMS -echo -e "${GREEN}Provisioning ${name}_worker in LMS...${NC}" -docker exec -t edx.devstack.lms bash -c "source /edx/app/edxapp/edxapp_env && python /edx/app/edxapp/edx-platform/manage.py lms --settings=devstack_docker manage_user ${name}_worker ${name}_worker@example.com --staff --superuser" - -# Create the DOT applications - one for single sign-on and one for backend service IDA-to-IDA authentication. -docker exec -t edx.devstack.lms bash -c "source /edx/app/edxapp/edxapp_env && python /edx/app/edxapp/edx-platform/manage.py lms --settings=devstack_docker create_dot_application --grant-type authorization-code --skip-authorization --redirect-uris 'http://localhost:${port}/complete/edx-oauth2/' --client-id '${name}-sso-key' --client-secret '${name}-sso-secret' --scopes 'user_id' ${name}-sso ${name}_worker" -docker exec -t edx.devstack.lms bash -c "source /edx/app/edxapp/edxapp_env && python /edx/app/edxapp/edx-platform/manage.py lms --settings=devstack_docker create_dot_application --grant-type client-credentials --client-id '${name}-backend-service-key' --client-secret '${name}-backend-service-secret' ${name}-backend-service ${name}_worker" - -# Restart enterprise.catalog app and worker containers -docker-compose restart app worker