2022-03-23 08:43:47 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2022-03-30 09:09:09 +00:00
|
|
|
APP=$1
|
|
|
|
|
|
|
|
cleanup() {
|
|
|
|
rm -rf "apps/$APP"
|
|
|
|
rm -rf sites/assets/*
|
|
|
|
}
|
2022-03-23 08:43:47 +00:00
|
|
|
|
|
|
|
cd /frappe-bench
|
|
|
|
|
2022-03-30 09:09:09 +00:00
|
|
|
if ! test -d "apps/$APP/$APP/public"; then
|
|
|
|
cleanup
|
|
|
|
exit 0
|
2022-03-23 08:43:47 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Add all not built assets
|
|
|
|
cp -r "apps/$APP/$APP/public" "/out/assets/$APP"
|
|
|
|
|
|
|
|
# Add production node modules
|
|
|
|
yarn --cwd "apps/$APP" --prod
|
|
|
|
cp -r "apps/$APP/node_modules" "/out/assets/$APP/node_modules"
|
|
|
|
|
|
|
|
# Add built assets
|
|
|
|
yarn --cwd "apps/$APP"
|
|
|
|
echo "$APP" >>sites/apps.txt
|
|
|
|
yarn --cwd apps/frappe run production --app "$APP"
|
|
|
|
cp -r sites/assets /out
|
|
|
|
|
2022-03-30 09:09:09 +00:00
|
|
|
cleanup
|