TreeMapperApp rails project to make scaffolding web projects.
Clone the repository
git clone git@github.com:jtorreggiani/skeleton.git
cd skeleton
- node
- yarn
- sqlite3
- chromdriver
- heroku
- User
- Post
Run rails setup script
./bin/setup
- rspec-rails
- simplecov
- yard
- yardstick
- rubocop
- brakeman
- rails_best_practices
- rubycritic
- bullet
- webpacker
- capybara
- pry-rails
- cucumber-rails
- selenium-webdriver
- devise
Run the development server
bundle exec rails server
open http://localhost:3000
Add pry
binding to debug code
def index
binding.pry
@variable = SomeModel.find(params[:id])
end
Run the tests
bundle exec rspec
Include spec documentation
bundle exec rspec --format=documentation
View test coverage
open coverage/index.html
Run acceptance tests
bundle exec cucumber
Run rubocop
bundle exec rubocop
Run rubycritic
bundle exec rubycritic --no-browser
Build documentation
bundle exec yard
Run documentation server
bundle exec yard server
open http://localhost:8808
Measure documentation coverage
bundle exec yardstick .
Run brakeman to check for security issues
bundle exec brakeman
Run best practices tool
bundle exec rails_best_practices .
Continuous Integration is the practice of merging code into the master version control branch at any time during they day. For default CI strategy for this application is CircleCI. The CI progress is configured in .circleci/config.yml
.
The default deployment strategy for the application is Heroku. Future tutorials will demonstrate deployment to different IaaS providers like AWS and Google Cloud. To get started make sure you have the Heroku CLI installed. Instructions for getting the CLI can be found here.
Login to Heroku
heroku login
heroku: Enter your login credentials
Email: example@example.com
Password: *****************
Logged in as example@example.com
Create staging environment
heroku apps:create application-name-staging --remote staging
Set staging environment variables
heroku config:set SKELETON_DATABASE_NAME=application_name_staging --remote staging
heroku config:set SKELETON_DATABASE_USERNAME=application_name_user --remote staging
heroku config:set SKELETON_DATABASE_PASSWORD=SECURE_PASSWORD --remote staging
Push code to staging environment
git push staging master
Migration staging database
heroku run rake db:migrate --remote staging
Ensure you have a dyno running
heroku ps:scale web=1 --remote production
Open app
heroku open --remote staging
Create production environment
heroku apps:create application-name-staging --remote production
Set staging environment variables
heroku config:set SKELETON_DATABASE_NAME=application_name_production --remote production
heroku config:set SKELETON_DATABASE_USERNAME=application_name_user --remote production
heroku config:set SKELETON_DATABASE_PASSWORD=SECURE_PASSWORD --remote production
Push code to production environment
git push production master
Migrate production database
heroku run rake db:migrate --remote production
Ensure you have a dyno running
heroku ps:scale web=1 --remote production
Open app
heroku open --remote production