Browse Source

dev_as_prod server, console, rake

main
pvincent 3 months ago
parent
commit
8191148f73
  1. 24
      bin/dev_as_prod

24
bin/dev_as_prod

@ -4,16 +4,18 @@ export RAILS_ENV=production
export SECRET_KEY_BASE=42
export SEMANTIC_LOGGER_APP=egr
if [[ -d public/assets ]]; then
echo "ASSETS are already precompiled: MODIFIED_TIME"
function usage {
echo "argument required:"
echo " server"
echo " console"
echo " <...> (any rake entry)"
}
command=$1
[[ -z "$command" ]] && usage && exit
if [[ $command =~ 'server|s' ]]; then
[[ -d public/assets ]] && echo "ASSETS are already precompiled: MODIFIED_TIME" || rails assets:precompile
rails server
else
rails assets:precompile
rails $command
fi
rails server
# TO REMOVE PROD assets:
# rm -rf public/assets
# journalctl --all -o cat --full -t egr
# journalctl --all -o short -full --no-hostname -t egr -f
Loading…
Cancel
Save