From 7780bf93bd106a3dcb64837ad92f2ec088b79dbc Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sat, 27 Sep 2025 23:13:49 -1000 Subject: [PATCH] Add Conductor configuration for Rails workspace setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added conductor.json with setup, run, and archive scripts - Created conductor-setup.sh script that: - Loads mise for Ruby version management - Verifies Ruby 3.2.0+ is available - Installs Ruby gem dependencies - Copies .env files from root if present - Clears logs and temp files - Configured nonconcurrent run mode for Rails server ๐Ÿค– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- conductor-setup.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++++ conductor.json | 8 ++++++++ 2 files changed, 59 insertions(+) create mode 100755 conductor-setup.sh create mode 100644 conductor.json diff --git a/conductor-setup.sh b/conductor-setup.sh new file mode 100755 index 0000000..68f8597 --- /dev/null +++ b/conductor-setup.sh @@ -0,0 +1,51 @@ +#!/bin/bash +set -e # Exit on any error + +echo "๐Ÿš€ Setting up Rails workspace..." + +# Load mise if available +if command -v mise &> /dev/null; then + eval "$(mise activate bash)" +fi + +# Check for required tools +if ! command -v ruby &> /dev/null; then + echo "โŒ Ruby is not installed. Please install Ruby first." + exit 1 +fi + +# Check Ruby version +RUBY_VERSION=$(ruby -v | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) +REQUIRED_VERSION="3.2.0" + +if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$RUBY_VERSION" | sort -V | head -n1)" != "$REQUIRED_VERSION" ]; then + echo "โŒ Ruby version $RUBY_VERSION is too old. Rails 8.0.3 requires Ruby >= $REQUIRED_VERSION" + echo " Please update Ruby using a version manager like rbenv, rvm, or asdf." + exit 1 +fi + +if ! command -v bundle &> /dev/null; then + echo "โŒ Bundler is not installed. Please install Bundler first." + exit 1 +fi + +# Copy environment files from root if they exist +if [ -f "$CONDUCTOR_ROOT_PATH/.env" ]; then + echo "๐Ÿ“‹ Copying .env file from root..." + cp "$CONDUCTOR_ROOT_PATH/.env" .env +fi + +if [ -f "$CONDUCTOR_ROOT_PATH/.env.local" ]; then + echo "๐Ÿ“‹ Copying .env.local file from root..." + cp "$CONDUCTOR_ROOT_PATH/.env.local" .env.local +fi + +# Install Ruby dependencies +echo "๐Ÿ“ฆ Installing Ruby gems..." +bundle install + +# Clear logs and temp files +echo "๐Ÿงน Cleaning logs and temp files..." +bin/rails log:clear tmp:clear + +echo "โœ… Setup complete! Click the Run button to start the Rails server." \ No newline at end of file diff --git a/conductor.json b/conductor.json new file mode 100644 index 0000000..6a4277a --- /dev/null +++ b/conductor.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "setup": "./conductor-setup.sh", + "run": "bin/dev", + "archive": "" + }, + "runScriptMode": "nonconcurrent" +} \ No newline at end of file