How to Push to Heroku From Personal Server? - ruby-on-rails

I've recently set up bare, shared repository on a personal server and would like to push to heroku directly from there -- that is, NOT use github.
I guess I'm not sure I understand every part of the line where we add a remote:
git remote add heroku myherokuusername?#heroku.com:myherokureponame?.git
git remote add heroku git#heroku.com:taraswebapp.git # normally this
git remote add heroku tara.byte#heroku.com:taraswebapp.git
Other information:
I'm working on mac os x, and have recently installed the relevant heroku toolbelt.
my origin is: tara#192.168.1.160:/rails_projects/taraswebapp.git, where that is the static ip of my server

If you are doing the changes locally, you were once able to git push heroku master from your repo. This second bare repo on your server would be another thing completely different.
Now if you are sharing your bare repo, that'll be a different story.
Update #1:
Store your app in git from heroku docs should get you started and show you how it's done with another repo too.

Related

engine yard No application found matching remotes:

I'm trying to deploy my application to production on my laptop but i keep getting a
No application found matching remotes:
git#github.com:this_is_the_old_github_remote/Application.git
so this used to be the old remote but it was recently changed
so this makes sense but how do I fix this issue and tell it to go to the new one
There are a couple of ways to work around this issue.
Update the repository's config to have the proper URL for your remote branch.
Tell the ey cli tool which application and environment you are trying to deploy to.
The first method is probably better so you do not have to worry about this in the future.
To update your repository configuration you simply need to run git remote set-url origin https://url.to/new/repo/Applicatoin.git
Once the repository in your git configuration and the Engine Yard dashboard match, you should be able to deploy normally.
To work around this issue via the Engine Yard CLI utility, you will need to run ey deploy --app=<Application Name> --environment=<Environment Name>.
Please keep in mind, regardless of which method above you use to work around this issue, Engine Yard's automation will pull the application from the repository you configured via the dashboard.
Updating the remote on your git configuration does not update Engine Yard's configuration.
If your local copy of the repository has changes that have not been pushed to the remote repository configured at Engine Yard, the changes will not propagate to your instances.
If you continue to run into any issues deploying, please feel free to contact us via http://support.cloud.engineyard.com or in IRC on irc.freenode.net in #EngineYard.

Using Heroku with Ruby on Rails

I have two questions about general usage with Heroku and RoR:
1) after I deploy my application onto Heroku, how can I apply new changes that I make?
2) After I deploy my application to Heroku, how do I "turn off" the server so that I can run my app locally again via localhost:3000? (for development & testing purposes)
Thanks!
Assuming you are using git to manage your project, you apply changes to Heroku by pushing them. This might look something like this:
git push heroku master
This pushes the master branch of your git project to Heroku.
To "turn off" your app on Heroku, you can do two things:
$ heroku ps:scale web=0
This completely turns off the application. You can also put it in maintenance mode, which simply prevents traffic to it:
$ heroku maintenance:on
That said, you don't need to turn off your app on Heroku while developing locally. The two environments are completely independent of each other.
Hope this link helps for part 1. Should be able to commit and push your changes using git push heroku master.
https://devcenter.heroku.com/articles/git#tracking-your-app-in-git
For part 2: will scaling your dynos back to 0 work for your case?
How to stop an app on Heroku?
When you make a change, just push the git repository to heroku again withgit push heroku master.
The server will automatically restart with the changed system.
You seem to have a misconception. You can always run your local development server regardless of what Heroku is doing (unless some other service your app connects to would become confused, of course; but if that happens, there is probably something wrong with your design). Nonetheless, if you want to stop the application on Heroku, just scale it to zero web dynos: heroku ps:scale web=0.

Existing Heroku app and Github

I have an existing Rails app at heroku. I have a github account.
I'd like to use the Github Mac app to view/commit changes and push back up to Heroku. Can this be done? Or can the Github Mac client only push/sync with repos at Github? Since the remote repo is already at Heroku, I'd just assume leave it there and not create a duplicate at Github too.
But, If this can't be done. What would be the best way set this up so I can update my local repo, then push to Github, and push to Heroku? All using the Github Mac app?
Thanks
As specified in the documentation, you can use a non-GitHub remote (like Heroku) also.

Git push heroku master fails without error

I can't push to heroku after committing changes to my local git repo. Heroku authentication works, rails app is up and running, github push still works, and heroku push used to work up until now - when git push heroku master from local app root directory suddenly started failing without error message. Can only interrupt with Ctrl-C.
Haven't found hints anywhere online yet..
Here's a few tips to try debugging and see what's happening. First, check the Heroku dashboard and see if Heroku is up. It's been down a few times in the past. Next, set GIT_SSH=/pathto/yourscript, where yourscript invokes ssh with -vvv (for verbose debugging). See if it's a network connectivity issue. Third, see if your repository is heavily loaded with commits (like tons of Binary files in the Git index). Ours used to be slow, when we realized this, and split it nicely so that it worked great. We also raised a Heroku support ticket to perform git gc --prune --aggressive remotely on our repo, and the problem got resolved for us.

Using GIT in production Rails machines

Should my production Rails project use GIT? it will be easy for me to update the
servers and to push hot fixes, but what if I'll have a conflict during a pull?
and if I'll accidentally pull something wrong it make cause some downtime.
What is your advice on how to synch between the GIT repository & production?
Thanks
How about using a dedicated deployment system like Capistrano? It solves many of the issues you are trying to avoid.
Don't leave local changes on your production machines, and there is no risk of conflicts.
Production installs should pull from a dedicated branch/tag (e.g. use gitflow, production machines pull from the latest tag or simply master) - not the branch you regularly push to (develop, if you use git-flow).

Resources