Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Useless tool for easy deploy Ruby on Rails to Heroku
If you're using continuous deployment with pipelines in Heroku, you won't need this. However if that style doesn't work, then this may allow you to manage databases and deployment with more control but less hassle.
Add this line to your application's Gemfile:
gem 'heroku_rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install heroku_rails
TODO: Some of these manual configuration steps, would be nicer to make a bit more automatic perhaps by making this a Rails engine.
Your database configuration (config/database.yml) needs to have a username if you want to use the db configurations
Append load "heroku_rails/tasks/db_drop_all_tables.rake"
to the end of Rakefile.
Copy templates into codebase:
cp $(bundle show heroku_rails)/templates/heroku.thor ./lib/tasks
cp $(bundle show heroku_rails)/templates/heroku_targets.yml ./config
update heroku_targets.yml with your staging and production targets. My set up for this is to have staging deploy the local version, but production deploy the origin/master.
TODO: more detail
You may want to set up a smoke test that your heroku targets are valid
require "heroku_rails/heroku_targets"
RSpec.describe "heroku_targets.yml" do
it "is valid (smoke test)" do
HerokuRails::HerokuTargets.from_file(Rails.root.join("config/heroku_targets.yml"))
end
end
Deploy the latest with db migrate during maintenance
thor heroku:deploy staging
or without maintenance
thor heroku:deploy staging --no-maintenance
or without migrating
thor heroku:deploy staging --no-migrate
or a specific tag/branch
thor heroku:deploy staging hotfix-branch
Sync a database down from remote to local
thor heroku:sync:grab -f staging
# when it finishes
rake db:drop_all_tables && thor heroku:sync:from_dump -f staging
FYI rake db:drop_all_tables is handy as it doesn't require you to disconnect any running processes from the database.
Copy production db to staging
thor heroku:sync:to staging -f production
NB: this won't work from a staging to a production environment (failsafe)
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Ensure standards before PR:
bundle exec standardrb --fix
Bug reports and pull requests are welcome on GitHub at https://github.com/siapbantu/heroku_rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the HerokuRails project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that heroku_rails demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.