Commit 37d2519b by Steven Zheng Committed by Steven Zheng

Add script to create test course on marketing site

parent 23444422
...@@ -103,11 +103,11 @@ vnc-passwords: ## Get the VNC passwords for the Chrome and Firefox Selenium cont ...@@ -103,11 +103,11 @@ vnc-passwords: ## Get the VNC passwords for the Chrome and Firefox Selenium cont
mysql-shell: ## Run a shell on the mysql container mysql-shell: ## Run a shell on the mysql container
docker-compose exec mysql bash docker-compose exec mysql bash
create-course-studio: ## Generates a course on studio using the configurations in test-course-studio.json create-course-studio: ## Generates a course on studio using the configurations in test-course.json
./course-generator/create-course-studio.sh ./course-generator/create-course-studio.sh ./course-generator/test-course.json
create-course-ecommerce: ## Generates a course on ecommerce using the configurations in test-course-ecommerce.json create-course-ecommerce: ## Generates a course on ecommerce using the configurations in test-course.json
./course-generator/create-course-ecommerce.sh ./course-generator/create-course-ecommerce.sh ./course-generator/test-course.json
check-memory: check-memory:
@if [ `docker info --format '{{json .}}' | python -c "import sys, json; print json.load(sys.stdin)['MemTotal']"` -lt 2147483648 ]; then echo "\033[0;31mWarning, System Memory is set too low!!! Increase Docker memory to be at least 2 Gigs\033[0m"; fi || exit 0 @if [ `docker info --format '{{json .}}' | python -c "import sys, json; print json.load(sys.stdin)['MemTotal']"` -lt 2147483648 ]; then echo "\033[0;31mWarning, System Memory is set too low!!! Increase Docker memory to be at least 2 Gigs\033[0m"; fi || exit 0
# Script that generates in ecommerce the courses in test-course-ecommerce.json # Script that generates in ecommerce the courses
SETTINGS=`tr -d '\n' < "course-generator/test-course-ecommerce.json"` if [ "$#" -ne 1 ]; then
docker exec -t edx.devstack.ecommerce bash -c "source /edx/app/ecommerce/ecommerce_env && python /edx/app/ecommerce/ecommerce/manage.py generate_courses '$SETTINGS'" echo "Must supply the course config file. E.g. create-course-ecommerce.sh test-course.json"
else
SETTINGS=`tr -d '\n' < "$1"`
docker exec -t edx.devstack.ecommerce bash -c "source /edx/app/ecommerce/ecommerce_env && python /edx/app/ecommerce/ecommerce/manage.py generate_courses '$SETTINGS'"
fi
# Script that generates in marketing the courses
if [ "$#" -ne 1 ]; then
echo "Must supply the course config file. E.g. create-course-marketing.sh test-course.json"
else
SETTINGS=`tr -d '\n' < "$1"`
docker exec -t edx.devstack.marketing bash -c "drush generate_courses '$SETTINGS'"
fi
# Script that generates in studio the courses in test-course-studio.json # Script that generates in studio the courses
SETTINGS=`tr -d '\n' < "course-generator/test-course-studio.json"` if [ "$#" -ne 1 ]; then
docker-compose exec lms bash -c "source /edx/app/edxapp/edxapp_env && python /edx/app/edxapp/edx-platform/manage.py cms --settings=devstack_docker generate_test_course '$SETTINGS'" echo "Must supply the course config file. E.g. create-course-studio.sh test-course.json"
else
SETTINGS=`tr -d '\n' < "$1"`
docker-compose exec lms bash -c "source /edx/app/edxapp/edxapp_env && python /edx/app/edxapp/edx-platform/manage.py cms --settings=devstack_docker generate_courses '$SETTINGS'"
fi
{
"courses": [
{
"organization": "test-course-generator",
"number": "2",
"run": "1",
"fields": {
"display_name": "verified-course"
},
"seats": [
{"seat_type": "audit"},
{"seat_type": "verified"}
]
}
]
}
{
"organization": "test-course-generator",
"number": "2",
"run": "1",
"fields": {
"display_name": "test-course",
"enable_proctored_exams": true
}
}
{
"courses": [
{
"organization": "test-course-generator",
"number": "1",
"run": "1",
"user": "edx@example.com",
"partner": "edx",
"fields": {
"display_name": "Test Course",
"enable_proctored_exams": null,
"mobile_available": null,
"discussion_link": null,
"course_survey_required": null,
"discussion_sort_alpha": null,
"social_sharing_url": null,
"enrollment_domain": null,
"entrance_exam_minimum_score_pct": null,
"max_student_enrollments_allowed": null,
"announcement": null,
"invitation_only": true,
"certificates_display_behavior": null,
"allow_anonymous": null,
"enrollment_start": null,
"start": null,
"catalog_visibility": null,
"instructor_info": null,
"display_organization": null,
"cert_name_short": null,
"course_survey_name": null,
"cert_html_view_overrides": null,
"bypass_home": null,
"has_children": null,
"entrance_exam_enabled": null,
"show_timezone": null,
"minimum_grade_credit": null,
"cert_name_long": null,
"cosmetic_display_price": null,
"ccx_connector": null,
"textbooks": null,
"advertised_start": null,
"certificate_available_date": null,
"allow_unsupported_xblocks": null,
"learning_info": null,
"discussion_blackouts": null,
"lti_passports": null,
"allow_public_wiki_access": null,
"allow_proctoring_opt_out": null,
"wiki_slug": null,
"tabs": null,
"remote_gradebook": null,
"is_new": null,
"discussion_topics": null,
"video_upload_pipeline": null,
"course_edit_method": null,
"issue_badges": null,
"certificates_show_before_end": null,
"teams_configuration": null,
"html_textbooks": null,
"disable_progress_graph": null,
"end": null,
"entrance_exam_id": null,
"no_grade": null,
"pdf_textbooks": null,
"certificates": null,
"pre_requisite_courses": null,
"enable_ccx": null,
"advanced_modules": null,
"end_of_course_survey_url": null,
"grading_policy": null,
"due_date_display_format": null,
"banner_image": null,
"display_coursenumber": null,
"allow_anonymous_to_peers": null,
"enrollment_end": null,
"create_zendesk_tickets": null,
"hide_progress_tab": null,
"show_calculator": null,
"language": null,
"css_class": null,
"cert_html_view_enabled": null,
"course_image": null,
"video_thumbnail_image": null,
"cohort_config": null,
"enable_subsection_gating": null,
"info_sidebar_name": null,
"enable_timed_exams": null,
"self_paced": null
},
"enrollment": {
"audit": true,
"honor": false,
"verified": true,
"professional_education": false,
"no_id_verification": false,
"credit": false,
"credit_provider": "test-credit-provider"
}
}
]
}
...@@ -12,3 +12,6 @@ up-marketing-sync: ## Bring up all services (including the marketing site) with ...@@ -12,3 +12,6 @@ up-marketing-sync: ## Bring up all services (including the marketing site) with
clean-marketing-sync: ## Remove the docker-sync containers for all services (including the marketing site) clean-marketing-sync: ## Remove the docker-sync containers for all services (including the marketing site)
docker-sync-stack clean -c docker-sync-marketing-site.yml docker-sync-stack clean -c docker-sync-marketing-site.yml
create-course-marketing: ## Generates a course on the marketing site using the configurations in test-course.json
./course-generator/create-course-marketing.sh ./course-generator/test-course.json
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment