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 productionInstall the required Ruby gem dependencies defined in the Gemfile, skipping gems used for production (like pg)- Check
config/database.ymlfor the correct database config (for development we recommend SQLite) rails 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 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 upDownload and start the VMvagrant sshLogin using SSH
cd hpi-swt2bundle install --without productionUpdate dependenciesrails db:migrate db:seedRun migrations, update databaserails s -b 0Start 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 OSexitExit SSH session
vagrant haltShuts down the VMvagrant global-statusShows status of all Vagrant VMs
bundle exec rails db:migrate RAILS_ENV=development && bundle exec rails db:migrate RAILS_ENV=testMigrate both test and development databasesbundle exec rails assets:clobber && bundle exec rails assets:precompileRedo 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>.rbSpecify a folder or test file to run- specify what tests to run dynamically by
-e 'search keyword in test name' bundle exec rspec --profileexamine 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 rubocopto find possible issues. - Use
--auto-correctto fix what can be fixed automatically. - The behavior of RuboCop can be controlled via a
.rubocop.ymlconfiguration file
rails c --sandboxTest out some code in the Rails console without changing any datarails dbconsoleStarts the CLI of the database you're usingbundle exec rails routesShow all the routes (and their names) of the applicationbundle exec rails aboutShow stats on current Rails installation, including version numbers
rails g migration DoSomethingCreate migration _db/migrate/*DoSomething.rb.