18

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?

mwfearnley
  • 3,303
  • 2
  • 34
  • 35
Nathan Bashaw
  • 561
  • 1
  • 5
  • 11

5 Answers5

21

First, you need to add the remote github repo:

git remote add origin git@github.com: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.

om-nom-nom
  • 62,329
  • 13
  • 183
  • 228
ConfusedNoob
  • 9,826
  • 14
  • 64
  • 85
3

It looks like you should be able to run git remote add heroku git@heroku.com:<application>.git and then git push heroku master

dkastner
  • 457
  • 4
  • 3
  • But then you need to add a heroku config to the server running cloud9...so that might not work unless you control the server. – dkastner Mar 17 '11 at 16:49
  • Thanks! I ran those commands and got this: `Warning: Permanently added 'heroku.com,75.101.145.87' (RSA) to the list of known hosts. Permission denied (publickey). fatal: The remote end hung up unexpectedly` – Nathan Bashaw Mar 18 '11 at 12:46
  • Ok for me with "git push ssh://git@github.com/molokoloco/jQuery.boxFx.git master:master" – molokoloco Nov 21 '11 at 09:47
3

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

tgkokk
  • 1,610
  • 1
  • 13
  • 16
2

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
Community
  • 1
  • 1
J_McCaffrey
  • 1,455
  • 12
  • 15
1

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 git@heroku.com:[projectname].git' Sub in your project name. Ex: git@heroku.com: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.

StewartArmbrecht
  • 1,221
  • 1
  • 10
  • 20