diff --git a/docker-compose-watchers.yml b/docker-compose-watchers.yml index aedd8fd710..161bc42427 100644 --- a/docker-compose-watchers.yml +++ b/docker-compose-watchers.yml @@ -7,7 +7,7 @@ services: environment: BOK_CHOY_HOSTNAME: edx.devstack.lms_watcher ASSET_WATCHER_TIMEOUT: 12 - image: edxops/edxapp:${OPENEDX_RELEASE:-latest} + image: appsembler/edxapp:${OPENEDX_RELEASE:-latest} volumes: - ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform:cached - edxapp_lms_assets:/edx/var/edxapp/staticfiles/ @@ -19,7 +19,7 @@ services: environment: BOK_CHOY_HOSTNAME: edx.devstack.studio_watcher ASSET_WATCHER_TIMEOUT: 12 - image: edxops/edxapp:${OPENEDX_RELEASE:-latest} + image: appsembler/edxapp:${OPENEDX_RELEASE:-latest} volumes: - edxapp_studio_assets:/edx/var/edxapp/staticfiles/ - ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform:cached diff --git a/docker-compose.yml b/docker-compose.yml index 8754c60436..70f748d4d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -143,7 +143,7 @@ services: BOK_CHOY_CMS_PORT: 18031 EDXAPP_TEST_MONGO_HOST: edx.devstack.mongo NO_PYTHON_UNINSTALL: 1 - image: edxops/edxapp:${OPENEDX_RELEASE:-latest} + image: appsembler/edxapp:${OPENEDX_RELEASE:-latest} ports: - "18000:18000" - "19876:19876" # JS test debugging @@ -189,7 +189,7 @@ services: BOK_CHOY_CMS_PORT: 18131 EDXAPP_TEST_MONGO_HOST: edx.devstack.mongo NO_PYTHON_UNINSTALL: 1 - image: edxops/edxapp:${OPENEDX_RELEASE:-latest} + image: appsembler/edxapp:${OPENEDX_RELEASE:-latest} ports: - "18010:18010" - "19877:19877" # JS test debugging diff --git a/provision-lms.sh b/provision-lms.sh index 3b7439a06d..4b1737df57 100755 --- a/provision-lms.sh +++ b/provision-lms.sh @@ -15,6 +15,9 @@ done docker-compose exec lms bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform && NO_PYTHON_UNINSTALL=1 paver install_prereqs' +#Installing Appsembler specific requirements +docker-compose exec lms bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform && NO_PYTHON_UNINSTALL=1 pip install --disable-pip-version-check --exists-action w -r requirements/edx/appsembler.txt' + #Installing prereqs crashes the process docker-compose restart lms @@ -32,7 +35,8 @@ docker-compose exec lms bash -c 'source /edx/app/edxapp/edxapp_env && python /ed docker-compose exec lms bash -c 'source /edx/app/edxapp/edxapp_env && python /edx/app/edxapp/edx-platform/manage.py lms --settings=devstack_docker configure_commerce' # Create demo course and users -docker-compose exec lms bash -c '/edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook /edx/app/edx_ansible/edx_ansible/playbooks/demo.yml -v -c local -i "127.0.0.1," --extra-vars="COMMON_EDXAPP_SETTINGS=devstack_docker"' +# ND: commenting this because we don't need demo course +# docker-compose exec lms bash -c '/edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook /edx/app/edx_ansible/edx_ansible/playbooks/demo.yml -v -c local -i "127.0.0.1," --extra-vars="COMMON_EDXAPP_SETTINGS=devstack_docker"' # Fix missing vendor file by clearing the cache docker-compose exec lms bash -c 'rm /edx/app/edxapp/edx-platform/.prereqs_cache/Node_prereqs.sha1' diff --git a/repo.sh b/repo.sh index 65480eafe7..beb4ec5ad0 100755 --- a/repo.sh +++ b/repo.sh @@ -17,11 +17,9 @@ else exit 1 fi -if [ -n "${OPENEDX_RELEASE}" ]; then - OPENEDX_GIT_BRANCH=open-release/${OPENEDX_RELEASE} -else - OPENEDX_GIT_BRANCH=master -fi +OPENEDX_GIT_BRANCH=open-release/hawthorn.master + +APPSEMBLER_EDX_PLATFORM_BRANCH="appsembler/tahoe/master" repos=( "https://github.com/edx/course-discovery.git" @@ -30,7 +28,7 @@ repos=( "https://github.com/edx/ecommerce.git" "https://github.com/edx/edx-e2e-tests.git" "https://github.com/edx/edx-notes-api.git" - "https://github.com/edx/edx-platform.git" + "https://github.com/appsembler/edx-platform.git" "https://github.com/edx/xqueue.git" "https://github.com/edx/edx-analytics-pipeline.git" ) @@ -40,7 +38,7 @@ private_repos=( "https://github.com/edx/edx-themes.git" ) -name_pattern=".*edx/(.*).git" +name_pattern=".*(edx|appsembler)/(.*).git" _checkout () { @@ -51,13 +49,13 @@ _checkout () # Use Bash's regex match operator to capture the name of the repo. # Results of the match are saved to an array called $BASH_REMATCH. [[ $repo =~ $name_pattern ]] - name="${BASH_REMATCH[1]}" + name="${BASH_REMATCH[2]}" # If a directory exists and it is nonempty, assume the repo has been cloned. if [ -d "$name" -a -n "$(ls -A "$name" 2>/dev/null)" ]; then echo "Checking out branch ${OPENEDX_GIT_BRANCH} of $name" cd $name - _checkout_and_update_branch + _appsembler_checkout_and_update_branch $name cd .. fi done @@ -77,20 +75,28 @@ _clone () # Use Bash's regex match operator to capture the name of the repo. # Results of the match are saved to an array called $BASH_REMATCH. [[ $repo =~ $name_pattern ]] - name="${BASH_REMATCH[1]}" + name="${BASH_REMATCH[2]}" # If a directory exists and it is nonempty, assume the repo has been checked out # and only make sure it's on the required branch if [ -d "$name" -a -n "$(ls -A "$name" 2>/dev/null)" ]; then printf "The [%s] repo is already checked out. Checking for updates.\n" $name cd ${DEVSTACK_WORKSPACE}/${name} - _checkout_and_update_branch + _appsembler_checkout_and_update_branch $name cd .. else - if [ "${SHALLOW_CLONE}" == "1" ]; then - git clone --single-branch -b ${OPENEDX_GIT_BRANCH} -c core.symlinks=true --depth=1 ${repo} + if [ "$name" == "edx-platform" ]; then + if [ "${SHALLOW_CLONE}" == "1" ]; then + git clone --single-branch -b ${APPSEMBLER_EDX_PLATFORM_BRANCH} -c core.symlinks=true --depth=1 ${repo} + else + git clone --single-branch -b ${APPSEMBLER_EDX_PLATFORM_BRANCH} -c core.symlinks=true ${repo} + fi else - git clone --single-branch -b ${OPENEDX_GIT_BRANCH} -c core.symlinks=true ${repo} + if [ "${SHALLOW_CLONE}" == "1" ]; then + git clone --single-branch -b ${OPENEDX_GIT_BRANCH} -c core.symlinks=true --depth=1 ${repo} + else + git clone --single-branch -b ${OPENEDX_GIT_BRANCH} -c core.symlinks=true ${repo} + fi fi fi done @@ -109,6 +115,27 @@ _checkout_and_update_branch () fi } +# our version to handle the fact that edx-platform needs a +# different branch, not `master` +_appsembler_checkout_and_update_branch () +{ + repo="$1" + if [ "${repo}" == "edx-platform" ]; then + + GIT_SYMBOLIC_REF="$(git symbolic-ref HEAD 2>/dev/null)" + BRANCH_NAME=${GIT_SYMBOLIC_REF##refs/heads/} + if [ "${BRANCH_NAME}" == "${APPSEMBLER_EDX_PLATFORM_BRANCH}" ]; then + git pull origin ${APPSEMBLER_EDX_PLATFORM_BRANCH} + else + git fetch origin ${APPSEMBLER_EDX_PLATFORM_BRANCH} + git checkout ${APPSEMBLER_EDX_PLATFORM_BRANCH} + fi + else + # default to the old behavior + _checkout_and_update_branch + fi +} + clone () { _clone "${repos[@]}" @@ -125,10 +152,14 @@ reset () for repo in ${repos[*]} do [[ $repo =~ $name_pattern ]] - name="${BASH_REMATCH[1]}" + name="${BASH_REMATCH[2]}" if [ -d "$name" ]; then - cd $name;git reset --hard HEAD;git checkout master;git reset --hard origin/master;git pull;cd "$currDir" + if [ "$name" == "edx-platform" ]; then + cd $name;git reset --hard HEAD;git checkout ${APPSEMBLER_EDX_PLATFORM_BRANCH};git reset --hard origin/${APPSEMBLER_EDX_PLATFORM_BRANCH};git pull;cd "$currDir" + else + cd $name;git reset --hard HEAD;git checkout master;git reset --hard origin/master;git pull;cd "$currDir" + fi else printf "The [%s] repo is not cloned. Continuing.\n" $name fi @@ -142,7 +173,7 @@ status () for repo in ${repos[*]} do [[ $repo =~ $name_pattern ]] - name="${BASH_REMATCH[1]}" + name="${BASH_REMATCH[2]}" if [ -d "$name" ]; then printf "\nGit status for [%s]:\n" $name