A Ruby on Rails app for managing time sheets of student assistants.
| Branch | Travis CI | Code Analysis | Heroku Deploy | Errbit |
|---|---|---|---|---|
| master | [link] | |||
| dev | [codeclimate diff to master] |
When TravisCI run all tests successfully, the build is deployed to heroku. This is done for the master branch as well as the dev branch.
bundle installInstall the required Ruby gem dependencies defined in the Gemfilecp database.sqlite.yml database.ymlSelect database config (for development we recommend SQLite)rake db:create db:migrate db:seedSetup database, run migrations, seed the database with defaultsrails sStart the Rails development server (By default runs on localhost:3000)bundle exec rspecRun all the tests (using the RSpec test framework)
If you want to use a VM to setup the project (e.g. when on Windows), we recommend Vagrant. Please keep in mind that this method may lead to a loss in performance, due to the added abstraction layer.
vagrant up # bring up the VM
vagrant ssh # login using SSH
cd hpi-swt2
echo "gem: --no-document" >> ~/.gemrc # disable docs for gems
bundle install # install dependencies
gem install pg # required for Postgres usage
cp config/database.psql.yml config/database.yml # in case you want to use Postgres
cp config/database.sqlite.yml config/database.yml # in case you want to user SQLite
exit # restart the session, required step
vagrant ssh # reconnect to the VM
cd hpi-swt2
rails s -b 0 # start the rails server
# the -b part is necessary since the app is running in a VM and would
# otherwise drop the requests coming from the host OS
The following environment variables should be set:
HOSTSECRET_KEY_BASEEMAIL_PWEMAIL_USERIDENTITY_URL
bundle exec rake db:migrate && bundle exec rake db:migrate RAILS_ENV=testMigrate dbsbundle exec rake assets:clobber && bundle exec rake assets:precompileRedo asset generationbundle exec rspec spec/<rest_of_file_path>.rbSpecify a folder or test file to runrails c --sandboxTest out some code in the Rails console without changing any datarails g migration DoSomethingCreate migration _db/migrate/*DoSomething.rb.rails dbconsoleStarts the CLI of the database you're usingbundle exec rake routesShow all the routes (and their names) of the applicationbundle exec rake aboutShow stats on current Rails installation, including version numbersbundle exec rspec --profileexamine how much time individual tests take