1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00
Maybe/bin/render-build.sh

26 lines
928 B
Bash
Raw Normal View History

2024-02-02 15:52:00 -06:00
#!/usr/bin/env bash
# exit on error
set -o errexit
echo "Installing gems..."
2024-02-02 16:13:06 -06:00
bundle install
echo "Precompiling assets..."
2024-02-02 16:13:06 -06:00
./bin/rails assets:precompile
./bin/rails assets:clean
echo "Build complete"
# Self Hosters:
#
# By default, one-click deploys are free-tier instances (to avoid unexpected charges)
# Render does NOT allow free-tier instances to use the `preDeployCommand` feature, so
# database migrations must be run in the build step.
#
# If you're on a paid Render plan, you can remove the `RUN_DB_MIGRATIONS_IN_BUILD_STEP` (or set to `false`)
if [ "$RUN_DB_MIGRATIONS_IN_BUILD_STEP" = "true" ]; then
echo "Initiating database migrations for the free tier..."
bundle exec rails db:migrate
echo "Database migrations completed. Reminder: If you've moved to a Render paid plan, you can remove the RUN_DB_MIGRATIONS_IN_BUILD_STEP environment variable to utilize the `preDeployCommand` feature for migrations."
fi