{"id":21409833,"url":"https://github.com/stackbuilders/railblazer","last_synced_at":"2025-07-15T16:09:19.032Z","repository":{"id":2942655,"uuid":"3955597","full_name":"stackbuilders/railblazer","owner":"stackbuilders","description":"Quick Rails app configuration","archived":false,"fork":false,"pushed_at":"2015-12-01T17:48:27.000Z","size":50,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-08T03:37:55.291Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackbuilders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-07T03:58:47.000Z","updated_at":"2019-08-13T15:00:22.000Z","dependencies_parsed_at":"2022-08-30T22:02:50.922Z","dependency_job_id":null,"html_url":"https://github.com/stackbuilders/railblazer","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/stackbuilders/railblazer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Frailblazer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Frailblazer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Frailblazer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Frailblazer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackbuilders","download_url":"https://codeload.github.com/stackbuilders/railblazer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Frailblazer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265233753,"owners_count":23731825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T17:34:32.384Z","updated_at":"2025-07-14T02:30:47.613Z","avatar_url":"https://github.com/stackbuilders.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Railblazer: Quick Rails app configuration\n\n[![Build Status](https://secure.travis-ci.org/stackbuilders/railblazer.png)](http://travis-ci.org/stackbuilders/railblazer)\n\nRailblazer helps you to spend less time setting up Rails apps, particularly on CI servers, by providing five scripts:\n\n1. `app_adapter`: given a Gemfile, determines whether the application runs on mysql, mysql2, or postgres\n2. `auto_configure`: outputs a database.yml based on a template when given an adapter and app name.\n3. `blaze`: build script that can be used by Jenkins\n4. `cap_deploy`: deploys an application with migrations using capistrano\n5. `heroku_deploy`: deploys an application to heroku, runs migrations, and restarts the app\n6. `runner`: script to run anything as the RVM Ruby\n\nIn other words, Railblazer tries to take the work out of setting up things like builds on CI servers, assuming you're using RVM and bundler in your applications.\n\n# Compatibility\n\nRailblazer only runs on Ruby 1.9.3 or newer Ruby versions. It can, however, be used to configure Rails apps using previous ruby versions.\n\n# Installation\n\nYou can install railblazer via the gem, but since gems that you install are limited to a particular gemset or Ruby version (assuming you're running rvm), you can just clone this repository. In order to\nrun the scripts in this package, just add the `bin` directory in this repository to your path.\n\n# app_adapter\n\n`app_adapter` detects the database adapter used in a Rails application when given a Gemfile path\nas an argument:\n\n```\napp_adapter ~/Code/project/Gemfile\n```\n\nThis will return a string like `mysql2` without a trailing newline (for easier inclusion in other scripts). The program will raise an error if exactly one adapter is not found. It currently only\nworks with applications that use the mysql, mysql2, or postgres (pg) adapters.\n\n# auto_configure\n\n`auto_configure` automatically generates a database.yml, sunspot.yml and redis configuration. This is generated from a template for mysql, mysql2, and postgres included with this gem.  If you want, you can also override the default templates by including templates in a directory named `~/.blaze/templates`.\n\nExample usage:\n\n```\nauto_configure RAILS_ROOT APP_OR_BUILD_NAME\n```\n\n# blaze\n\n`blaze` is a shell script that can be used by Jenkins. It assumes that for your build you don't want to run migrations, and that instead we should just drop the test db, re-create it, and load the schema.rb file.\n\nIt also does the following, which we find useful in our CI builds:\n\n1. Load the RVM environment\n2. Run bundle (excluding the production environment)\n3. Run the tests with xvfb-run, autodetecting an available buffer (for simultaneous builds that need to open windows, for things like Selenium)\n4. Auto-generate a database.yml (requires `app_adapter` to be in the `$PATH`)\n\nThe script uses variables like ${WORKSPACE} and ${JOB_NAME}, which are passed by default to scripts\ninvoked from Jenkins.\n\nExample usage:\n\n```\nblaze\n```\n\n# cap_deploy\n\nLoads rvm, and deploys application with migrations using capistrano. Usage:\n\n```\ncap_deploy DEPLOY_ENVIRONMENT\n```\n\nThis script depends on the variables $GIT_COMMIT and $WORKSPACE being set in the environment\nprior to invocation.\n\n# deploy_heroku\n\nPushes an application to Heroku, runs migrations, and restarts the app. Usage:\n\n```\nheroku_deploy APP_NAME\n```\n\n# runner\n\nRuns the given argument as if it was run from the command line after loading RVM. Usage:\n\n```\nrunner \"rake db:migrate\"\n```\nThis script depends on the variables $GIT_COMMIT and $WORKSPACE being set in the environment\nprior to invocation.\n\n# Concurrency\n\nRailblazer is designed to help you run multiple builds in parallel for different projects. This means that it has to\nnamespace the data stores your application may use. It namespaces things in the following way:\n\n1. Databases - databases are namespaced according to the application name given to the auto-configuration scripts\n2. SOLR - If your application uses sunspot_rails, Railblazer generates a sunspot.yml that chooses a random port in the 8900 range\n3. Redis - If your application uses resque, we randomly choose a database number from 0 - 63, initialize a redis connection and whack this into your rails app with a sledgehammer (overwriting any connections you may initialize with Resque.redis or $redis). You will probably need to set your redis.conf databases to 64, instead of the default 16 for this to work.\n\nSuggestions are always welcome about how to make Rails applications automatically play nicer in the same sandbox.\n\n# Summary\n\nRailblazer helps with configuration of database connections in Rails apps, and provides scripts which can help with configuraiton of Rails apps for CI server builds.\n\nInstead of relying on the database.sample.yml files included in many Rails apps, I find that it's often easier to just copy a working database.yml from another project on my computer. These settings reflect things like the correct host and username / password configuration for my local workstation. I think that we can move towards slightly less configuration work for new Rails apps on workstations that are already in use by developers by building up frameworks that:\n\n1. use local templates for database configuration and\n2. auto-detect the database adapter from the Rails application configuration.\n\nRailblazer provides a first pass at automating this type of configuration, and provides a script showing how this is useful in the context of auto-configuring apps for Jenkins CI server.\n\n# Author\n\nJustin Leitgeb \u003cjustin@stackbuilders.com\u003e\n\n# License\n\nSee the LICENSE file included with the program.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbuilders%2Frailblazer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackbuilders%2Frailblazer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbuilders%2Frailblazer/lists"}