From 9fa68c0ea938bd6302bc6c81f870955e5941ae70 Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Mon, 10 Nov 2025 12:45:49 +0000 Subject: [PATCH] Add Trilogy adapter --- Gemfile | 1 + Gemfile.lock | 2 ++ bin/setup | 21 ++++++++++++--------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index cc719e2d8..5932188ce 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ gem "solid_cache", "~> 1.0" gem "solid_queue", "~> 1.2" gem "sqlite3", ">= 2.0" gem "thruster", require: false +gem "trilogy", "~> 2.9" # Features gem "bcrypt", "~> 3.1.7" diff --git a/Gemfile.lock b/Gemfile.lock index 802fe5e78..c16b85b63 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -514,6 +514,7 @@ GEM thruster (0.1.16-x86_64-darwin) thruster (0.1.16-x86_64-linux) timeout (0.4.4) + trilogy (2.9.0) tsort (0.2.0) turbo-rails (2.0.20) actionpack (>= 7.1.0) @@ -628,6 +629,7 @@ DEPENDENCIES sqlite3 (>= 2.0) stimulus-rails thruster + trilogy (~> 2.9) turbo-rails vcr web-console diff --git a/bin/setup b/bin/setup index b32c2d96c..414077301 100755 --- a/bin/setup +++ b/bin/setup @@ -2,16 +2,19 @@ set -eo pipefail # Prefer app executables -app_root="$(cd "$(dirname "$0")/.."; pwd)" +app_root="$( + cd "$(dirname "$0")/.." + pwd +)" export PATH="$app_root/bin:$PATH" # Install gum if needed -if ! command -v gum &> /dev/null; then +if ! command -v gum &>/dev/null; then echo echo "▸ Installing gum" - if command -v pacman &> /dev/null; then + if command -v pacman &>/dev/null; then sudo pacman -S --noconfirm gum - elif command -v brew &> /dev/null; then + elif command -v brew &>/dev/null; then brew install gum else echo "Please install gum: https://github.com/charmbracelet/gum" @@ -35,12 +38,12 @@ step() { } needs_seeding() { - if [ "$CI" != "" ] ; then + if [ "$CI" != "" ]; then return 1 fi has_tenant=$(bin/rails runner "pp ApplicationRecord.tenants.any? { ApplicationRecord.with_tenant(_1) { Account.sole } }" 2>/dev/null) - if [ "$has_tenant" = "true" ] ; then + if [ "$has_tenant" = "true" ]; then return 1 else return 0 @@ -48,7 +51,7 @@ needs_seeding() { } echo -gum style --foreground 153 " ˚ ∘ ∘ ˚ " +gum style --foreground 153 " ˚ ∘ ∘ ˚ " gum style --foreground 111 --bold " ∘˚˳°∘° 𝒻𝒾𝓏𝓏𝓎 °∘°˳˚∘ " echo @@ -56,7 +59,7 @@ step "Installing Ruby" mise install --yes eval "$(mise hook-env)" if which pacman >/dev/null 2>&1; then - packages=(imagemagick openslide libvips) + packages=(imagemagick mariadb-libs openslide libvips) if ! pacman -Q "${packages[@]}" >/dev/null 2>&1; then step "Installing packages" sudo pacman -S --noconfirm --needed "${packages[@]}" fi @@ -68,7 +71,7 @@ step "Set up gh-signoff" bash -c "gh extension install basecamp/gh-signoff || gh bundle config set --local auto_install true step "Installing RubyGems" bundle install -if [ -e tmp/minio-dev.txt ] ; then +if [ -e tmp/minio-dev.txt ]; then step "Starting Docker services" bash -c "[ -d ~/Work/basecamp/docker-dev ] && git -C ~/Work/basecamp/docker-dev pull || gh repo clone basecamp/docker-dev ~/Work/basecamp/docker-dev && ~/Work/basecamp/docker-dev/setup minio" step "Configuring MinIO" bin/minio-setup