From 72e0043d1d5263d9e336e121dc79275a35554aa8 Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Wed, 22 Feb 2023 11:22:12 -0500 Subject: [PATCH] refactor!: remove unused provisioning scripts (#31811) These scripts were written to replace some of the Ansible provisioning steps in Devstack, before tCRIL's focus turned to Tutor. These scripts never ended up being used by Devstack, but Devstack's maintainers did end up replacing the Ansible provisioning steps with some direct Bash commands in Devstack's provision-lms.sh: https://github.com/openedx/devstack/blob/23e16c1ddad3c18cbb539fecc5237d28b387bdc4/provision-lms.sh#L51-L68 Tutor has its own user & course provisioning scripts, written in Sh using Tutor's jobs framework. Thus, these scripts are no longer needed and do not seem to be in use. --- scripts/provision-demo-course.sh | 31 --------------------- scripts/provision-demo-users.sh | 47 -------------------------------- 2 files changed, 78 deletions(-) delete mode 100755 scripts/provision-demo-course.sh delete mode 100755 scripts/provision-demo-users.sh diff --git a/scripts/provision-demo-course.sh b/scripts/provision-demo-course.sh deleted file mode 100755 index 72d2639f1af7..000000000000 --- a/scripts/provision-demo-course.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -# Usage: -# In a CMS-enabled container, -# from the directory /edx/app/edxapp/edx-platform, run: -# ./scripts/provision-demo-course.sh -# -# This file is an experimental re-implementation of demo course provisioning -# process defined in this Ansible role: -# https://github.com/openedx/configuration/tree/master/playbooks/roles/demo -# -# It was written as part of the effort to move our dev tools off of Ansible and -# Paver, described here: https://github.com/openedx/devstack/pull/866 -# TODO: If the effort described above is abandoned, then this script should -# probably be deleted. - -set -xeuo pipefail - -DEMO_COURSE_KEY='course-v1:edX+DemoX+Demo_Course' - -# Delete the demo course clone (if it exists) and then do a shallow re-clone of it. -mkdir -p /edx/app/demo -( - cd /edx/app/demo && - rm -rf edx-demo-course && - git clone https://github.com/openedx/openedx-demo-course.git --depth 1 -) - -# Import the course. -./manage.py cms import /edx/var/edxapp/data /edx/app/demo/edx-demo-course - diff --git a/scripts/provision-demo-users.sh b/scripts/provision-demo-users.sh deleted file mode 100755 index 3aa51eeeb1a1..000000000000 --- a/scripts/provision-demo-users.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# Usage: -# In an LMS-enabled container, -# from the directory /edx/app/edxapp/edx-platform, run: -# ./scripts/provision-demo-users.sh -# -# This file is an experimental re-implementation of demo user provisioning -# process defined in this Ansible role: -# https://github.com/openedx/configuration/tree/master/playbooks/roles/demo -# -# It provisions five users: -# * edx (global superuser) -# * staff (global staff) -# * verified -# * audit -# * honor -# Each of which has {username}@example.com as their email and 'edx' as their password. -# -# It was written as part of the effort to move our dev tools off of Ansible and -# Paver, described here: https://github.com/openedx/devstack/pull/866 -# TODO: If the effort described above is abandoned, then this script should -# probably be deleted. - -set -xeuo pipefail - -DEMO_COURSE_KEY='course-v1:edX+DemoX+Demo_Course' - -# Hash of 'edx' password. -DEMO_PASSWORD_HASH='pbkdf2_sha256$20000$TjE34FJjc3vv$0B7GUmH8RwrOc/BvMoxjb5j8EgnWTt3sxorDANeF7Qw=' - -# Create users (if they don't exist) and set passwords. -# 'password_is_edx' is purposefully unquoted so that it expands into two arguments. -password_is_edx="--initial-password-hash $DEMO_PASSWORD_HASH" -./manage.py lms manage_user edx edx@example.com $password_is_edx --superuser -./manage.py lms manage_user staff staff@example.com $password_is_edx --staff -./manage.py lms manage_user verified verified@example.com $password_is_edx -./manage.py lms manage_user audit audit@example.com $password_is_edx -./manage.py lms manage_user honor honor@example.com $password_is_edx - -# Enroll users in demo course. -for username in staff verified audit honor; do - ./manage.py lms enroll_user_in_course -e "${username}@example.com" -c "$DEMO_COURSE_KEY" -done - -# Seed the forums for the demo course. -./manage.py lms seed_permissions_roles "$DEMO_COURSE_KEY"