forked from overhangio/tutor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: symlink to prebuilt artifacts from bindmount
- Loading branch information
1 parent
efbfffa
commit 90b3b6d
Showing
5 changed files
with
109 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/sh | ||
# | ||
# Several important build artifacts need to be generated in the edx-platform repo. | ||
# However, when a developer bind-mounts edx-platform, it completely overwrites the repo. | ||
# So, the Dockerfile generates the artifacts outside of edx-platform (at /openedx/artifacts) | ||
# where they will not be overwritten by a bind-mount. This script ensures that edx-platform | ||
# contains symlinks into edx-platfor. This script is run both in the Dockerfile and in lms's | ||
# init job; that way, the symlinks exist regardless of whether edx-platform is bind-mounted. | ||
# | ||
# ARTIFACT DIRECTORY | PURPOSE | ||
# ----------------------------------+--------------------------------------------- | ||
# Open_edX.egg-info | edx-platform metadata generated by setup.py | ||
# node_modules | npm packages | ||
# common/static/common/js/vendor | npm JS copies, for use by RequireJS | ||
# common/static/common/css/vendor | npm CSS copies, for use by RequireJS | ||
# common/static/bundles | JS bundles, generated by Webpack | ||
# cms/static/css | Studio CSS, compiled from Sass | ||
# lms/static/css | LMS CSS, compiled from Sass | ||
# lms/static/certificates/css | Certificate CSS, compiled from Sass | ||
|
||
echo "Symlinking build artifacts in /openedx/edx-platform to /openedx/artifacts..." | ||
set -x | ||
|
||
mkdir -p /openedx/artifacts | ||
|
||
for dir in \ | ||
Open_edX.egg-info \ | ||
node_modules \ | ||
common/static/common/js/vendor \ | ||
common/static/common/css/vendor \ | ||
common/static/bundles \ | ||
cms/static/css \ | ||
lms/static/css \ | ||
lms/static/certificates/css ; do | ||
|
||
# If there isn't a symlink or there's one to the wrong place, then fix it | ||
if test `readlink -f $dir` != /openedx/artifacts/$dir ; then | ||
|
||
# If there's an existing symlink (to the wrong place), delete it | ||
if [ -L $dir ] ; then | ||
rm $dir | ||
|
||
# If there's a file or a dir already, back it up | ||
elif [ -d $dir || -f $dir ] ; then | ||
mv -f $dir $dir.bak | ||
fi | ||
|
||
# Create the correct symlink | ||
ln -s /openedx/artifacts/$dir $dir | ||
fi | ||
done | ||
|
||
set -x | ||
echo "Done symlinking build artifacts." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.