Skip to content

Instantly share code, notes, and snippets.

@secretpray
Last active March 31, 2022 15:01
Show Gist options
  • Save secretpray/b14b3e3b4df09cbb6113e9047c7a1f21 to your computer and use it in GitHub Desktop.
Save secretpray/b14b3e3b4df09cbb6113e9047c7a1f21 to your computer and use it in GitHub Desktop.

Algo 1

Before

git status
git add .
git commit
git push Stage_xx
git checkout main
git branch -D Stage_xx
git pull
  1. Create (new name: recipes-2021)
heroku create recipes-2021
  1. Set master key on Heroku
heroku config:set RAILS_MASTER_KEY=`cat config/master.key`

or

heroku config:set RAILS_MASTER_KEY=`cat config/credentials/production.key`

if prod.env

heroku config:set RAILS_MASTER_KEY=`cat config/credentials/production.key`

or (copy content of production.key)

heroku config:set RAILS_MASTER_KEY=content of production

else

heroku config:set RAILS_MASTER_KEY=`cat config/master.key`

or

heroku config:set RAILS_MASTER_KEY=content of master.key
  1. Create ProcFile (touch Procfile)
web: bundle exec rails s
release: rails db:migrate
  1. Add or check Linux platform to Gemfile.lock
bundle lock --add-platform x86_64-linux
PLATFORMS
  x86_64-darwin-20
  x86_64-linux
  1. Git repo update:
git status
git add .
git commit
git push Stage_xx
git checkout main
git branch -D Stage_xx
git pull
  1. Push resource
git push heroku main

or

git push heroku Stage_xx:master
  1. On Heroku in console
heroku run rake db:migrate
heroku run rake db:seed
heroku run console
heroku logs --tail

for testing:

heroku config -a recipes-2021
heroku config:set S3_BUCKET_NAME=reciperail
heroku run rails console
Rails.application.credentials.config

Run

heroku open

Setting Change Boot Timeout (https://tools.heroku.support/limits/boot_timeout) The new boot timeout will take effect after your next deployment. You can redeploy your code without any changes by running:

Algo 2 (modejs bootstarp5 rails 7)

heroku login  
heroku create  
echo "web: bundle exec puma -C config/puma.rb" >> Procfile  
bundle lock --add-platform x86_64-linux  
heroku addons:create heroku-postgresql:hobby-dev  
heroku buildpacks:add heroku/ruby  
heroku buildpacks:add heroku/nodejs  
git add . && git commit -m 'ready for prod'  
git push heroku main  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment