Skip to content

Instantly share code, notes, and snippets.

@jmchilton
Created November 12, 2012 15:52
Show Gist options
  • Save jmchilton/4060124 to your computer and use it in GitHub Desktop.
Save jmchilton/4060124 to your computer and use it in GitHub Desktop.
MSI Software Accounting Development
<h3>Development Setup for MSI Software Accounting Webapp</h3>
<p>Setup RVM, used to manage your ruby environment.
</p>
<pre>
%\curl -L https://get.rvm.io | bash -s
</pre>
<p>Configure your current shell session to use RVM.</p>
<pre>
source ~/.rvm/scripts/rvm
</pre>
<p>Optionally, you can also add the following line to <code>$HOME/.bashrc</code> to always setup RVM.</p>
<pre>
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
</pre>
<p>Setup an RVM environment for ruby 1.8.7 and install bundler (bundler in turn will be used to install gems needed for software accounting page).</p>
<pre>
% rvm install 1.8.7
% rvm use 1.8.7
% gem install bundler
</pre>
<p>Check out the software accounting code base:</p>
<pre>
% git clone git@github.com:jmchilton/msi_software_accounting.git
% cd msi_software_accounting
% bundle install
</pre>
<p>Setup test database</p>
<pre>
% rake db:migrate
</pre>
<p>Make changes then test.</p>
<pre>
% rake
</pre>
<h3>Deploying Changes</h3>
<p>Once local changes have been made and pushed to github, they may be deployed using Capistrano (installed as part of <code>bundle install</code> above).</p>
<p>Deploying via Capistrano requires that you first have an SSH key setup so that you may ssh into the <code>softacct</code> account on the production server <code>appdev-dom0.msi.umn.edu</code>. If you already have an ssh key configured, you can skip the following step.</p>
<pre>
% ssh-keygen -t dsa
</pre>
Next, send your public key <code>$HOME/.ssh/id_dsa.pub</code> to John (chilton@msi.umn.edu) and he will install it on appdev-dom0 for you.
Once the key is in place, all you should need to do to deploy the latest code in githup to appdev-dom0 is run the following command:
<pre>
% cap deploy
</pre>
<p>Ruby/Rails Environment</p>
<a href="http://rubyonrails.org/">Rails</a> | <a href="http://guides.rubyonrails.org/migrations.html">Setting up a Rails database migration</a>
<a href="http://rspec.info/">RSpec</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment