Skip to content

Commit c24c700

Browse files
authored
Merge pull request #139 from edx/pwnage101/fix-edx-themes
fix: make edx-themes provisioning respect $DEVSTACK_WORKSPACE
2 parents bceadf1 + cbc3e75 commit c24c700

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

provision-set-edx-theme.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@
22

33
# This script sets up the edX theme in LMS and CMS.
44

5-
REPO_URL="[email protected]:edx/edx-themes.git"
5+
REPO_URL_HTTPS="https://github.com/edx/edx-themes.git"
6+
REPO_URL_SSH="[email protected]:edx/edx-themes.git"
67
THEME_DIR="/edx/src/edx-themes/edx-platform"
78
DEVSTACK_FILE="./py_configuration_files/lms.py"
89

910
# Clone the edx-themes repository into the src directory
10-
cd ../src
11+
mkdir -p ${DEVSTACK_WORKSPACE}/src
12+
pushd ${DEVSTACK_WORKSPACE}/src
1113
if [ ! -d "edx-themes" ]; then
12-
git clone "$REPO_URL"
14+
# Make a best effort to use SSH, but if that doesn't work then fallback to HTTPS.
15+
# Also make a best effort to avoid terminal prompting which breaks automation.
16+
GIT_TERMINAL_PROMPT=0 GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=accept-new" git clone --depth=1 "$REPO_URL_SSH"
17+
[[ ! -d "edx-themes" ]] && GIT_TERMINAL_PROMPT=0 git clone --depth=1 "$REPO_URL_HTTPS"
1318
else
1419
echo "Directory 'edx-themes' already exists. Skipping clone."
1520
fi
16-
cd ../devstack
21+
popd
1722

1823
# Uncomment relevant lines in the devstack.py file
1924
sed -i '' "s|^# from .common import _make_mako_template_dirs|from .common import _make_mako_template_dirs|" "$DEVSTACK_FILE"

0 commit comments

Comments
 (0)