Repo for Public Site
Ruby CSS JavaScript Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
data
db
lib
public
script
spec
vendor
views
.gitignore
.rbenv-vars
.rbenv-version
.rvmrc
.tesh_env.yaml
.vagrant
CHANGES.rdoc
Capfile
Gemfile
Gemfile.lock
Guardfile
Procfile
README.rdoc
Rakefile
Vagrantfile
app.rb
config.ru

README.rdoc

BAMRU-Public

This is the BAMRU website at www.bamru.org.

The old application was written in the 2004 era. It was written in PHP, using a MySQL database.

The goal of the rewrite is to make the app simpler to maintain and extend. Hopefully we'll be more efficient using newer tools:

  • ORM [ActiveRecord]

  • lightweight app framework [Sinatra]

  • source code control [Git]

  • automated regressions testing [Rspec]

  • script tool [Rake]

  • deploy tool [Capistrano]

  • library manager [Bundler]

Installing & Running the App

You can clone the app and run it on your system. This is going to work best on Linux (ubuntu). Mac hasn't been tested. Windows will be painful, at best. (must have cygwin, at a minimum)

To install the app, first install ruby, git, rubygems. Then:

> gem install bundler
> git clone https://github.com/andyl/BAMRU-Public
> cd BAMRU-Public
> bundle install
> rake run_server

Running the App:

  1. start your browser

  2. visit http://localhost:9393

Editing/Updating the App

Please include tests with any update you make.

To see a list of test/edit commands, run

rake -T

Deploying the App

All of the deployment scripts are in the Capfile.

Note that we use a 'multistage' strategy with Capistrano. Defined stages are:

  • vagrant

  • devstage

  • pubstage

  • production

Environment definitions for the various stages are saved in the 'config/deploy' directory.

To see a list of deployment commands, run

cap -T

Provisioning a Staging Server

We use Vagrant to provision a basic staging server.

vagrant up

This will provision the staging server from scratch, with all the tools needed to run a production system. Support software includes:

  • nginx

  • passenger

Once the staging server is provisioned, deploy the code using:

> cap vagrant deploy:setup
> cap vagrant deploy

Management Console

You can bring up a management console for a production system using the command:

> cap production console

This will bring up a Tmux session with pages that stream server logs, system monitors, etc.

Account Credentials

This app interacts with 3rd party services (Gmail, Gcal). Account Credentials for these services not stored in the source code repository. See Andy to get this info.

Scheduled Tasks

The set of scheduled (cron) tasks associated with this app is defined in `config/schedule.rb`. Scheduled tasks are defined for log-file rotation and database backups.