From e23808d261a6ada8032bdfc3ffeb6e4df9fbce18 Mon Sep 17 00:00:00 2001 From: vhsdream Date: Tue, 10 Jun 2025 12:40:39 -0400 Subject: [PATCH] MaybeFinance: move Ruby check/install/update to later --- ct/maybefinance.sh | 3 ++- install/maybefinance-install.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ct/maybefinance.sh b/ct/maybefinance.sh index 0f3a2440..fadb7395 100644 --- a/ct/maybefinance.sh +++ b/ct/maybefinance.sh @@ -49,11 +49,12 @@ function update_script() { rm ./config/credentials.yml.enc source ~/.profile $STD tar -xf "$BACKUP_FILE" --directory=/ + RUBY_VERSION="$(cat /opt/maybe/.ruby-version)" RUBY_INSTALL_RAILS=false setup_rbenv_stack $STD ./bin/bundle install $STD ./bin/bundle exec bootsnap precompile --gemfile -j 0 $STD ./bin/bundle exec bootsnap precompile -j 0 app/ lib/ export SECRET_KEY_BASE_DUMMY=1 - $STD ./bin/rails assets:precompile + $STD dotenv -f ./.env ./bin/rails assets:precompile $STD dotenv -f ./.env ./bin/rails db:prepare msg_ok "Updated $APP to v${RELEASE}" diff --git a/install/maybefinance-install.sh b/install/maybefinance-install.sh index eed461e2..a24ddba2 100644 --- a/install/maybefinance-install.sh +++ b/install/maybefinance-install.sh @@ -34,7 +34,6 @@ $STD apt-get install -y --no-install-recommends \ msg_ok "Installed Dependencies" PG_VERSION=16 install_postgresql -RUBY_VERSION=3.4.1 RUBY_INSTALL_RAILS=false setup_rbenv_stack msg_info "Setting up Postgresql" DB_NAME="maybe" @@ -56,6 +55,7 @@ curl -fsSL "https://github.com/maybe-finance/maybe/archive/refs/tags/v${RELEASE} unzip -q /tmp/v"$RELEASE".zip mv maybe-"$RELEASE" /opt/maybe cd /opt/maybe +RUBY_VERSION="$(cat /opt/maybe/.ruby-version)" RUBY_INSTALL_RAILS=false setup_rbenv_stack cp ./.env.example ./.env sed -i -e '/SELF_/a RAILS_ENV=production' \ -e "s/secret-value/\"$(openssl rand -hex 64)\"/" \ @@ -77,7 +77,7 @@ $STD ./bin/bundle install $STD ./bin/bundle exec bootsnap precompile --gemfile -j 0 $STD ./bin/bundle exec bootsnap precompile -j 0 app/ lib/ export SECRET_KEY_BASE_DUMMY=1 -$STD ./bin/rails assets:precompile +$STD dotenv -f ./.env ./bin/rails assets:precompile $STD dotenv -f ./.env ./bin/rails db:prepare echo "${RELEASE}" >/opt/maybe_version.txt msg_ok "Installed ${APPLICATION}"