Nathan Bashaw
Nathan Bashaw

Reputation: 551

How can I push changes directly from Cloud9 IDE to Heroku?

I'm a (non-technical) intern at a place where I can't use my normal laptop, and I have a lot of free time. I'm learning how to program, and I'd like to be able to use a completely cloud-based development environment, because I can't install anything on the computer I have access to here.

I signed up for Cloud9 IDE, connected it to my GitHub account, and cloned a repo containing a little Sinatra project I'm working on. The problem is, I don't know how to push any changes I make in Cloud9 to Heroku. Basically I'm flying blind. If I were on my laptop, I'd just hop on terminal, commit my changes, and run git push heroku master. At work, that's not an option, since I'm not developing anything locally. Cloud9 has a console built in with git installed, so I tried installing rubygems by running git clone https://github.com/rubygems/rubygems.git so I could install the heroku gem, but I couldn't figure out how to unpack / install it.

Am I on the right path? Any suggestions as to how I can develop entirely in the cloud?

Upvotes: 18

Views: 12464

Answers (5)

StewartArmbrecht
StewartArmbrecht

Reputation: 1251

Here is what I did (I already had my project connected to github):

After creating the project connected to github:

  1. Run 'git remote add heroku [email protected]:[projectname].git' Sub in your project name. Ex: [email protected]:gherkinrunner.git
  2. Then follow these directions: https://docs.c9.io/deploying_via_cli.html
  3. Then navigate back to your workspace (/home/ubuntu/workspace) in the cloud9 ide terminal
  4. Run 'heroku login' and login using your credentials.
  5. Run 'heroku keys:add'
  6. Run 'git push heroku'

That's it for me.

Upvotes: 1

J_McCaffrey
J_McCaffrey

Reputation: 1455

You can use cloud9 to manage a github repo and deploy to heroku. I just did this task today, for an open source demo site for captcha plugins for Rails, after someone pointed out that my demo site had a broken link.

The steps are detailed very clearly here

My steps:

  1. log in to cloud9ide.com (I use my github credentials)
  2. pull down project from github listings
  3. edit files
  4. in command line (at the bottom of the cloud9 page) git commit -am "fix the issue"
  5. click deploy, select 'simple-captcha-demo' from heroku list (I had already connected)
  6. click "Yes" to have cloud9 create a package.json file
  7. manually create a blank Procfile (to get past next error)
  8. git commit -am to push that Procfile out
  9. click deploy again
  10. confirm that my changes were deployed

Once you get past the 2 errors, the flow would just be

  1. edit your files
  2. git commit -am 'your commit message'
  3. deploy to heroku
  4. git push origin master # to push changes up to github

Upvotes: 2

ConfusedNoob
ConfusedNoob

Reputation: 10196

First, you need to add the remote github repo:

git remote add origin [email protected]:username/yourapp.git
git push origin master

You'll then probably get: "Permission Denied (publickey)".

You have to tell github about the SSH key that cloud9ide is using. You can see your SSH key on the cloud 9 dashboard at http://cloud9ide.com/dashboard.html by clicking the 'show your SSH key' link.

Click the copy button to copy your SSH key to the clipboard. Now, head on over to github.com. Login and click Account Settings. Choose the 'SSH Public Keys' option and 'Add another public key'. Save your changes. You are now, good to go and can push from your cloud9 repo.

Upvotes: 21

tgkokk
tgkokk

Reputation: 1608

As of 1 Sep 2011, Cloud9IDE supports Heroku for Node.js (support for other languages is coming soon). Read more here.

Upvotes: 3

dkastner
dkastner

Reputation: 457

It looks like you should be able to run git remote add heroku [email protected]:<application>.git and then git push heroku master

Upvotes: 3

Related Questions