Skip to content

Instantly share code, notes, and snippets.

@markquezada
markquezada / heroku-remote.md
Created September 30, 2021 23:37 — forked from randallreedjr/heroku-remote.md
Add a Heroku remote to an existing git repo

Working with git remotes on Heroku

Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.

Adding a new remote

Add a remote for your Staging app and deploy

Note that on Heroku, you must always use master as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch seen below (in this example, we push the local staging branch to the master branch on heroku.

$ git remote add staging https://git.heroku.com/staging-app.git

Keybase proof

I hereby claim:

  • I am markquezada on github.
  • I am markquezada (https://keybase.io/markquezada) on keybase.
  • I have a public key ASA-Z_yNSkKBKr-NyMXnUl8DoRsc4_KB1Jl7T1GlY2RpWAo

To claim this, I am signing this object:

test:
override:
- bundle exec rspec spec
deployment:
acceptance:
branch: master
commands:
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>:
timeout: 300

Keybase proof

I hereby claim:

  • I am markquezada on github.
  • I am markquezada (https://keybase.io/markquezada) on keybase.
  • I have a public key whose fingerprint is 2A2B 02B0 2360 AD9F 7F81 F367 CBC3 73F9 D24A 34E0

To claim this, I am signing this object:

function __git_dirty {
git diff --quiet HEAD &>/dev/null
[ $? == 1 ] && echo "!"
}
function __git_branch {
__git_ps1 "(%s)"
}
function __my_rvm_ruby_version {
/*
Form Elements
-- Styled to look like native Safari on OS X.
-- Drop-down <select> menus are unaffected.
-- Buttons are unaffected. Native OS style.
*/
input,
button,
select,
# The basic idea is that we take the existing data via ActiveRecord
# and create new documents in MongoDB using MongoMapper.
# This method is necessary as we want to keep all the associations of existing dataset
# and by the way, clean up empty columns
# We rely on models still being ActiveRecord::Base, I bet you can figure out how the look like.
# And have the newer MongoDB ones here in a module, painful as we have to set the collection_name
# Don't put a +timestamps!+ into your MongoMapper models yet because this would change the updated_at if existing
# As you see in the MongoDB models, a few loose their indepence, e.g. Source as I
# plan to add other sources besides flickr, or Page and Album which only make sense in
# their parent Website
development: &global_settings
database: textual_development
host: 127.0.0.1
port: 27017
test:
database: textual_test
<<: *global_settings
production:
# include this in application controller
module Authentication
protected
# Inclusion hook to make #current_user and #signed_in?
# available as ActionView helper methods.
def self.included(base)
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method
end
# Returns true or false if the user is signed in.