Multiple Instances of an app on Heroku - ruby-on-rails

I need to deploy several instances of the same app on heroku. It appears that I need to have a branch and local repo for each instance to deploy each instance to heroku via the cli. This just doesnt seem right.
Does anyone have any experience in this area?

You will need to have a git remote set up for each heroku app, but you can push to any remote from one local repo.
You can use the heroku git:remote command to set up multiple git remotes for your multiple heroku apps. Run that command with --help to see all the options, but this would create a git remote called staging for a heroku app named chunky-bacon-1234:
$ heroku git:remote -r staging -a chunky-bacon-1234
Then, if you wanted to deploy your local branch named my-experiment to that heroku app, you can push that branch to the remote's master branch:
$ git push staging my-experiment:master

Related

What is the flow of information when deploying an application on heroku servers?

According to what I have figured out..
Create local repo => add remote origin and PUSH to bitbucket =>create heroku =>push to heroku from master, from local repo and not from bitbucket
Please verify this flow.
You don't need this step - add remote origin and PUSH to bitbucket.
You add heroku as remote url to your git. You can read more about deployment process and what's going in official heroku doc - Deploying with Git.
Deploy a rails app to heroku is ideal. Just go through heroku official document here.
Hear I add some essential command, you need to run sequential, after push new changes to git repository.
> heroku login
> heroku create
> git push heroku master
> heroku run rake db:migrate
If you use Github then you can easily link your Heroku app with Github repo and all your Heroku code automatically pushed to Heroku.
This option is not available for BitBucket now.

I can't make a change on my web site after successfully deployed.

I successfully deployed my rails app on heroku and launched officially but can't make a change to my rails app. I run git push heroku after I edited html code but nothing changed on home page.
I get below when I run git push heroku
everything up to date
I'm sure I run git add ., git commit before git push heroku. Does anyone know why? I need your help.
Make sure you're on the master branch which Heroku uses to deploy your app. So run git checkout master before adding and committing your file. Then use git push heroku master to deploy.

heroku staging - not able to push

I am not able to push to staging for heroku.
When I am doing git remote staging master I am getting
fatal: 'staging' does not appear to be a git repository
fatal: Could not read from remote repository.
Although I used to push to staging using the same command.
git remote -v
returns
origin git#bitbucket.abc/test.git (fetch)
origin git#bitbucket.org:abc/test.git (push)
I tried to add a git remote, but It created something else and when I did git push staging master, It created another url of the app instead of pushing for the earlier staging url.
I am not able to resolve this. Also I am the owner of the heroku app.
There is only one git repo configured here, and that is a bitbucket git repo. You need to add the heroku configuration too. See this link for reference.
Ultimately, run something like heroku git:remote -a heroku-app-name -r staging. Then you can do git push staging master and it'll push to the given app.

git push heroku master - no error messages but changes not displaying on web app

After installing the devise gem to create users on my web app, my changes are not appearing on the live app.
I believe I am running the correct code in terminal (I am following the one-month-rails course):
$ git add .
$ git commit -am "message"
$ git push
$ git push heroku master
The push to heroku runs through and I don't receive an error message, however, when I try to access my heroku page
$ heroku open
The changes are not displayed on the live web-app.
All the changes are displayed when running the rails server on the localhost. Furthermore, the activity log on the heroku website shows that my push went through and that its running the same version as my most recent push to github.
Any thoughts?
Best,
Brian
** Also posted this response here: git push heroku master says "Everything up-to-date", but the app is not current
Even though this is an old issue, I wanted to update with what worked for me (a newbie) should anyone else run into this:
After following the instructions here (from Hudson), what finally did the trick for me was doing a "git pull" after checking out the "master" branch. Perhaps "git push heroku master" pushes out only the local branch of master?
Of course, this assumes all required changes have been correctly merged into your master. I hadn't pulled from master on my local since the project set up because all merges (from development to master) were handled on GitHub and I had been working on new branches that were later merged with development.
So, to restate steps above from Hudson:
git checkout master
git pull
(here, I updated README to have a change to commit, like "Heroku deploy [date, time]"
git add .
git commit -am "xxxyyzzz"
git push heroku master
heroku run rake db:migrate
heroku restart
Good luck!
I could resolve my issue only by making a new_branch and pushing that on heroku:
git checkout -b new_branch
git add .
git commit -m "Just a test commit to push new branch to heroku"
git push heroku new_branch:master
heroku restart
You should take care of following things when you have your hands on heroku
run pending migrations if any heroku run rake db:migrate
restart your heroku app after successful run of migrations heroku restart not needed if you have only code changes, but a good practice to do.
verify assets are getting compiled properly on a push, if not you can heroku run rake assets:precompile

Heroku app must now use github. Does it still nee to have the git#heroku.com remote?

I've got an app on heroku, but the time has come to leverage github.
I've ran
$ git rm remote origin
and added the github repo as the master. I've pushed up to github.
But when i run
$ git remote -v
it lists the github repo, but it still also list the remote at git#heroku.com.
Do I need to remove the git#heroku.com remote in order to have heroku always pull off of my github repo when launching the app?
You can have as many local remotes as you want and it won't effect what Heroku does.

Resources