This Ruby on Rails application enables managing of virtual machines via VMware vSphere.
Branch | Travis CI | Coverage | CodeClimate | Codefactor | Codebeat |
---|---|---|---|---|---|
master | --- | ||||
dev |
The application requires access to internal resources, which are not directly available from the general internet. Therefore, the application is deployed on university servers.
An overview of the status of all involved systems is available here: https://stats.uptimerobot.com/j8DADFQnv
Errors that occur in the deployed systems are reported to a central Errbit error collection application. It can be found here:
You can login using your GitHub credentials.
Automatic deployments are handled by a dedicated application:
The application shows an overview of the latest deployment attempts and handles deployment (via mina) to the university internal systems when it receives a POST request. These requests are send by Travis CI after a successful build, see the .travis.yml.
Note: Please be aware that the application is designed to manage internal university resources. These are only available from the internal network. Therefore, currently a VPN connection to the university network is required for those parts of the application that interact with internal resources.
bundle install --without production
Install the required Ruby gem dependencies defined in the Gemfile, skipping gems used for production (like pg)- Check
config/database.yml
for the correct database config (for development we recommend SQLite) rails db:migrate db:seed
Setup database, run migrations, seed the database with defaultsrails s
Start the Rails development server (By default runs on localhost:3000)bundle exec rspec
Run 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 in combination with Virtualbox. The Vagrantfile
in the project root contains the needed configuration. If you have trouble starting the VM, try changing the parameters to adapt to your hardware.
Please keep in mind that this method may lead to a loss in performance, due to the added abstraction layer.
vagrant up
Download and start the VMvagrant ssh
Login using SSH
cd hpi-swt2
bundle install --without production
Update dependenciesrails db:migrate db:seed
Run migrations, update databaserails 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 OSexit
Exit SSH session
vagrant halt
Shuts down the VMvagrant global-status
Shows status of all Vagrant VMs
bundle exec rails db:migrate RAILS_ENV=development && bundle exec rails db:migrate RAILS_ENV=test
Migrate both test and development databasesbundle exec rails assets:clobber && bundle exec rails assets:precompile
Redo asset generation
- To run the full test suite:
bundle exec rspec
. - For fancier test running use option
-f doc
bundle exec rspec spec/<rest_of_file_path>.rb
Specify a folder or test file to run- specify what tests to run dynamically by
-e 'search keyword in test name'
bundle exec rspec --profile
examine how much time individual tests take
- RuboCop is a Ruby static code analyzer and formatter, based on the community Ruby style guide
- It is installed in the project. Run
bundle exec rubocop
to find possible issues. - Use
--auto-correct
to fix what can be fixed automatically. - The behavior of RuboCop can be controlled via a
.rubocop.yml
configuration file
rails c --sandbox
Test out some code in the Rails console without changing any datarails dbconsole
Starts the CLI of the database you're usingbundle exec rails routes
Show all the routes (and their names) of the applicationbundle exec rails about
Show stats on current Rails installation, including version numbers
rails g migration DoSomething
Create migration _db/migrate/*DoSomething.rb.