0

I wonder how people are prototyping for EC2.

In my case i want to code locally in my preferred editor and sync to a test instance and debug there, is this common practice? (vi/vim over ssh is not an option)

If so, are there any tools to sync code locally with a test instance other than rsync/sftp, anything automated?

If not, what are the options?

Any tips/walkthrough of how your code/debug cycle for EC2 looks like (pre commit), are appreciated.

2 Answers2

3

My preferred setup is to

  • Code on a local machine
  • Check into version control
  • Use continuous automation to get the checkins to version control and create a build
  • Push the build result to a QA (or prototyping in your case) instance on EC2 (I used Maven, you could use FTP or rsync).
  • When the QA (or prototyping) box is doing what you want, create an AMI of it. Use that AMI to launch production instances.
Eric J.
  • 147,927
  • 63
  • 340
  • 553
  • the thing i'm concerned about is pushing code to version control that is not debugged. i'm used to only commit code that does compile. so you go through a clean-up of your commits at the end of each coding session (typos, etc)? –  Jul 18 '12 at 21:53
  • 1
    You debug on your local box. You're also making sure the code passes unit tests on your local box (you have unit tests, right?). A build server will fail if the unit tests don't pass, so won't push code any further. – Eric J. Jul 18 '12 at 22:03
  • what if i can't build on my local box due to requirements or i'm coding torwards a different plattform? –  Jul 18 '12 at 22:53
  • How do you test your code on the local box if you can't build there? If you are e.g. doing Java development on Windows and deploying to Linux that's not a problem at all. – Eric J. Jul 18 '12 at 23:19
  • that's my point, i want to write code locally, sync to an ec2 instance & debug/test/build on it. –  Jul 18 '12 at 23:32
  • 1
    If you use git there's no reason you couldn't setup your test instance as a separate remote, so you could push there without pushing to your main repo. You can rebase/edit as needed before pushing to your main repo. And you can of course have your own little branch – Frederick Cheung Jul 19 '12 at 08:56
  • Thanks Frederik, i guess i'll stick with that. –  Jul 19 '12 at 13:04
1

Revision control is your friend. Make you local code changes, submit them to your revision control server, then pull the changes into you amazon instance.

Mike Brant
  • 70,514
  • 10
  • 99
  • 103