Same git repository, multiple apps on different Heroku accounts - ruby-on-rails

I have this scenario:
I need to provide the same application to different clients, but they would have access to their own database and their own heroku account.
For example if I have 20 clients, when I make a push to my github repo, all their apps who are connected to my repo should be deployed(and run a rake task like db:migrate)...so I can easily update the application.
The clients shouldn't have access to the application source, just to their own database and command line.
Can anyone tell me how this can be achieved with heroku? Are there any services that do that?
Thanks

Related

Are all my Ruby files in my Rails project stored on the server I specify? (eg. Puma, Webrick)

When I enter a URL into my browser, and it sends a request to the server (in this case, the host is salty-headland-18854.herokuapp.com), are all my Rails files stored at this host?
How does Puma come into play? I understand Puma to be a web server and I've included its gem. What is the distinction here between the host and Puma?
Does Heroku have a bunch of physical computers somewhere, that house my literal .rb files?
Visual of my question
It depends on the files, but pretty much the answer is yes. Heroku pulls down your app from the git repository specified (or you push it to Heroku's git repository) and Heroku has all the files from that. Without a security exploit, no one is able to access their source.
You can think of a Heroku Dyno as a Linux server with the complete Rails application. When it is launched for the first time, a linux server is built and the Rails application copied to it and the app server launched.
You code actually lives in the Github repository you have linked to Heroku. Persistant data is stored either in the database or an external file service such as S3.
It is possible to run commands on the Dynos using heroku run
Reference

How to deploy a Ruby on Rails project to Amazon?

I have developed rails application, which I now want to deploy to an Amazon server. How can I do this?
Also I have registered domain name from godaddy.
The easiest way to do so is to have your application stored on a Git repository, Github for example. Then on your Amazon machine, clone your repo and you will have all your file on the cloud (almost) ready to use. Take a look at this documentation from Amazon for more infos.
For your domain, you must create a redirection to your Amazon machine IP. Here is a link you should see.

Rails + Capistrano + Git: Steps to successfully deploy an app?

We use git for version control. Right now only my account seems to be able to deploy successfully to a remote server for several apps, but I don't know why. I would like to set it up so that deploying works for other people at my company, but I don't really have the full picture laid out in my head so I don't know what needs to be done.
To me it seems like whoever wants to deploy needs a: user account on the server, an account on github, and permission to pull...? However, other users seem to have the notorious Permission denied (publickey). fatal: The remote end hung up unexpectedly and other errors.
Can anyone provide a short list of what I need to do on the server (make an account, add ssh keys or something?) and git (ssh keys again? not sure) to get the deploy to work?
Capistrano assumes you can ssh into the server you are deploying to. You are probably using a communal apps, deployer, or some other app-specific user to deploy your app. This will be the user that is set in your deploy.rb file.
You will need to copy everyone's public key into the authorized_keys of whatever your deploying user is. That is just how Capistrano works.

Is it possible to connect single Heroku-RedisToGo from 2 different Heroku instances?

I have one Rails instance and another Node.js instance. The plan is to publish information from the Rails project using Redis's pubsub and subscribe by the Node.js program. The node.js program will publish the information to other clients through web sockets (or long polls).
The whole thing is working perfectly while deployed in combination of remote linux machines. On Heroku, Redis To Go is added as an add-on with the Rails instance. Redis can be connected and working fine from this instance.
But I am not getting how to reach to this Redis add-on from the Node.js instance. I've added REDISTOGO_URL from the environment of Rails instance to the environment of Node.js, but it's not working. Sample errors I'm getting (from logs and REPL) are
redis.set("a","b");
==> Error: Connection in pub/sub mode, only pub/sub commands may be used
redis.psubscribe('*');
==> false
Can somebody please show me a way how to accomplish this?
Yes, all you have to do is set the heroku config value similar to:
'heroku config:add REDISTOGO_URL=[your redis togo url]'
Heroku will then add your config var and restart your app.
You can check to make sure it's added correctly by doing a 'heroku config' on both repositories and comparing them.

Change email associated with git rep - to allow for heroku deployment

I set up a rails app on a laptop, and started local git repository on that lap top.
I've copied that app folder onto another machine - using copy & paste.
From the second machine, I'm trying to deploy the app to Heroku.
I'm getting the following error -
! my.personal.email#gmail.com not authorized to access little-extras
I'd like to change the repo to be associated with the email I use for on my second laptop. As this is the email I have connected to my heroku account.
how can I do this?
Your ssh key is associated with a different account than you created the application with. One way to deal with this is to share the app with the account that the ssh key is associated with:
heroku sharing:add my.personal.email#gmail.com
I'd guess you probably need to run heroku auth:login.

Resources