-
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.
fix build + update max-old-space-size
- Loading branch information
1 parent
17f245a
commit bc9b40a
Showing
2 changed files
with
14 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -Ex | ||
|
||
function apply_path { | ||
mainjs=./build/server.js | ||
bundlejs=./build/public/static/js/*.js | ||
test -f $mainjs | ||
|
||
echo "Check that we have API_PATH and API vars" | ||
test -n "$API_PATH" | ||
|
||
echo "Changing built files inplace" | ||
sed -i "s#VOLTO_API_PATH#${API_PATH}#g" $mainjs | ||
sed -i "s#VOLTO_API_PATH#${API_PATH}#g" $bundlejs | ||
sed -i "s#VOLTO_INTERNAL_API_PATH#${INTERNAL_API_PATH}#g" $mainjs | ||
sed -i "s#VOLTO_INTERNAL_API_PATH#${INTERNAL_API_PATH}#g" $bundlejs | ||
|
||
echo "Zipping JS Files" | ||
gzip -fk $mainjs | ||
function apply_rebuild { | ||
mkdir -p /app/src/addons | ||
gosu node yarn develop | ||
gosu node yarn | ||
gosu node yarn build | ||
} | ||
|
||
# Should we monkey patch? | ||
test -n "$API_PATH" && apply_path | ||
# Should we re-build | ||
test -n "$REBUILD" && apply_rebuild | ||
|
||
if [[ "$1" == "yarn"* ]]; then | ||
echo "Starting Volto" | ||
exec gosu node "$@" | ||
fi | ||
|
||
echo "Starting Volto" | ||
exec "$@" |