Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
fix: move 2u repos list out of code. added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
christopappas committed Feb 2, 2024
1 parent 90351ea commit 6751341
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,15 @@ non_release_ssh_repos=(
"[email protected]:openedx/frontend-app-profile.git"
"[email protected]:openedx/frontend-app-ora-grading.git"
)
# Space separated list of repos that use 2u specific branch
twou_main_repos="ecommerce yourownrepo"
# Space separated list of repos that use 2u specific branch should be
# set in your environment. example:
# export TWOU_MAIN_REPOS="ecommerce yourownrepo"
#
# If TWOU_MAIN_REPOS is set in the env, then TWOU_CHECKOUT_BRANCH must
# also be set. Here is an example of how to update your bashrc
# file, so that you can get these variables created (note, TWOU_MAIN_REPOS
# likely will grow over time, and not just use ecommerce'):
# $ echo -e "\nexport TWOU_CHECKOUT_BRANCH=\"2u/main\"\nexport TWOU_MAIN_REPOS=\"ecommerce yourownrepo\"" >> ~/.bash_profile

if [ -n "${OPENEDX_RELEASE}" ]; then
OPENEDX_GIT_BRANCH=open-release/${OPENEDX_RELEASE}
Expand Down Expand Up @@ -135,14 +142,14 @@ _clone ()
_checkout_and_update_branch
cd ..
else
if [ -n "${TWOU_CHECKOUT_BRANCH}" ] && echo "${twou_main_repos}" | grep -o "${name}"; then
if [ -n "${TWOU_CHECKOUT_BRANCH}" ] && echo "${TWOU_MAIN_REPOS}" | grep -o "${name}"; then
CLONE_BRANCH="-b ${TWOU_CHECKOUT_BRANCH}"
elif [ -n "${OPENEDX_GIT_BRANCH:-}" ]; then
CLONE_BRANCH="-b ${OPENEDX_GIT_BRANCH}"
else
CLONE_BRANCH=""
fi
echo "CLONE_BRANCH is ${CLONE_BRANCH}"

if [ "${SHALLOW_CLONE}" == "1" ]; then
git clone ${CLONE_BRANCH} -c core.symlinks=true --depth=1 "${repo}"
else
Expand All @@ -158,7 +165,7 @@ _checkout_and_update_branch ()
GIT_SYMBOLIC_REF="$(git symbolic-ref HEAD 2>/dev/null)"
BRANCH_NAME=${GIT_SYMBOLIC_REF##refs/heads/}

if [ -n "${TWOU_CHECKOUT_BRANCH}" ] && echo "${twou_main_repos}" | grep -o "${name}"; then
if [ -n "${TWOU_CHECKOUT_BRANCH}" ] && echo "${TWOU_MAIN_REPOS}" | grep -o "${name}"; then
CHECKOUT_BRANCH="${TWOU_CHECKOUT_BRANCH}"
elif [ -n "${OPENEDX_GIT_BRANCH}" ]; then
CHECKOUT_BRANCH=${OPENEDX_GIT_BRANCH}
Expand Down

0 comments on commit 6751341

Please sign in to comment.