Ringmaster is a tool for Release Management Risk Mitigation. It allows release engineers to take a deterministic approach to release management.
We recommend using rvm, the Ruby Version Manager, to create a project-specific gemset for the application.
Here are the gems used by the application:
- Devise - authentication and user management
- figaro - configuration framework
- simple_form - forms made easy
- high_voltage - rails engine for static pages
These gems make development easier:
- better_errors - helps when things go wrong
- quiet_assets - suppresses distracting messages in the log
- rails_layout - generates files for an application layout
- rpsec-rails - testing framework for rails 3.x and 4.x
Front-end framework:
- bootstrap-sass - Bootstrap for CSS and JavaScript
You should run the bundle install
command to install the required gems on your computer:
$ bundle install
You can check which gems are installed on your computer with:
$ gem list
Keep in mind that you have installed these gems locally. When you deploy the app to another server, the same gems (and versions) must be available.
The application uses the figaro gem to set environment variables in the config/application.yml file. The .gitignore file prevents the config/application.yml file from being saved in the git repository so your credentials are kept private.
You can add any credentials to the file config/application.yml:
# Add account credentials and API keys here.
# This file should be listed in .gitignore to keep your settings secret!
# Each entry sets a local environment variable and overrides ENV variables in the Unix shell.
# For example, setting:
# GMAIL_USERNAME: Your_Gmail_Username
# makes 'Your_Gmail_Username' available as ENV["GMAIL_USERNAME"]
# Add application configuration variables here, as shown below.
#
GMAIL_USERNAME: Your_Username
GMAIL_PASSWORD: Your_Password
ADMIN_EMAIL: [email protected]
ADMIN_PASSWORD: changeme
All configuration values in the config/application.yml file are available anywhere in the application as environment variables. For example, ENV["GMAIL_USERNAME"]
will return the string “Your_Username”.
If you prefer, you can delete the config/application.yml file and set each value as an environment variable in the Unix shell.
For the Gmail username and password, enter the credentials you use to log in to Gmail when you check your inbox.
Set values for ADMIN_EMAIL
and ADMIN_PASSWORD
for a user that is created when the database is seeded. You will be able to log in to the application with these credentials.
The db/seeds.rb file initializes the database with default values. To keep some data private, and consolidate configuration settings in a single location, we use the config/application.yml file to set environment variables and then use the environment variables in the db/seeds.rb file.
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
# Environment variables (ENV['...']) can be set in the file config/application.yml.
puts 'DEFAULT USERS'
user = User.find_or_create_by_email :email => ENV['ADMIN_EMAIL'].dup, :password => ENV['ADMIN_PASSWORD'].dup, :password_confirmation => ENV['ADMIN_PASSWORD'].dup
puts 'user: ' << user.email
You can change the administrator email, and password in this file but it is better to make the changes in the config/application.yml file to keep the credentials private. If you decide to include your private password in the db/seeds.rb file, be sure to add the filename to your .gitignore file so that your password doesn’t become available in your public GitHub repository.
Note that it’s not necessary to personalize the db/seeds.rb file before you deploy your app. You can deploy the app with an example user and then use the application’s “Edit Account” feature to change email address and password after you log in. Use this feature to log in as an administrator and change the email and password to your own.
Once you’ve cloned the repo, prepare the database and add the default user to the database by running the commands:
$ rake db:migrate $ rake db:seed
Use rake db:reset
if you want to empty and reseed the database.
Set the database for running tests:
$ rake db:test:prepare
If you’re not using rvm, the Ruby Version Manager, you should preface each rake command with bundle exec
. You don’t need to use bundle exec
if you are using rvm version 1.11.0 or newer.
Once you’ve cloned the application directly from GitHub, it is crucial that you change the application’s secret token before deploying your application in production mode. Otherwise, people could change their session information, and potentially access your site without permission. Your secret token should be at least 30 characters long and completely random.
Get a unique secret token:
$ rake secret
Edit your config/initializers/secret_token.rb file to add the secret token:
RailsDevise::Application.config.secret_key_base = '...some really long, random string...'
You can check that your application runs properly by entering the command:
$ rails server
To see your application in action, open a browser window and navigate to http://localhost:3000/.
You should see a home page with a navigation bar.
You should be able to click the navigation links for “Log in” and “Sign up.”
Stop the server with Control-C. If you test the app by starting the web server and then leave the server running while you install new gems, you’ll have to restart the server to see any changes. The same is true for changes to configuration files in the config folder. This can be confusing to new Rails developers because you can change files in the app folders without restarting the server. Stop the server each time after testing and you will avoid this issue.
This program is provided under an Apache open source license, read the LICENSE.txt file for details.