Skip to content

Instantly share code, notes, and snippets.

@ianballou
Created January 26, 2023 20:04
Show Gist options
  • Save ianballou/334c06aa4acd5c4415f36b1c86ff94d6 to your computer and use it in GitHub Desktop.
Save ianballou/334c06aa4acd5c4415f36b1c86ff94d6 to your computer and use it in GitHub Desktop.
Katello development tips
Dev env tips
- Start rails in one terminal: bundle exec foreman start rails
- Start webpack in another terminal: bundle exec foreman start webpack
- Debug a file:
1) Edit ~/foreman/.env to ensure puma is running with a single CPU
2) Restart your server
3) Insert `binding.pry` where you need to debug
-> If it's a test, `require pry-byebug` at the top
4) Save the file
5) Run the code and check the rails terminal
6) You'll see the debugger is open and you can type commands
-> What you're typing may not show up on the terminal. I don't mind it, but if you do, perhaps try a remote debugging server.
-> Try require 'byebug'; byebug; if you can't see what you're typing
- Keep DB up to date:
bundle exec rake db:migrate
bundle exec rake db:seed
- Reset Katello, Candlepin, and Pulp:
bundle exec rake katello:reset
- Reset test DB:
RAILS_ENV=test bundle exec rake db:drop
RAILS_ENV=test bundle exec rake db:create
RAILS_ENV=test bundle exec rake db:migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment