Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

First allow me to say that this is a beginner type question. I'm not much a system admin and more a developer. At any rate...

I've created a custom, private AMI to be used when launching server instances for my web application on Amazon's EC2 service. The AMI does not contain the application itself, but simply the environment it needs to run in (Java, Tomcat, Subversion). What I'm curious about is how to go about checking out or updating the application source from a specified SCM repository using some sort of shell or even an ant script.

I don't really see why it couldn't be possible, but I'm not exactly sure as to a "good" way to about it. In other words, what would you consider to be the best way?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

I think Maven is the best way to do things like this if it is Java related. However if you are not using it, it is a new technology with a learning curve. Plus it needs a Nexus repository

If you don't want to do that, you should do the following:

  • Put your startup script on S3
  • Put your application on S3
  • When you startup your AMI, the startup info (a section where you can give it a custom startup script), can be fixed. It pulls your startup script from S3 and runs it. Your startup script pulls your application and installs it.-

You can use: Tim Kay's AWS script (google it) to easily pull stuff from S3, you could pass the keys in with a machine startup.

I setup something similar and that is how I did it (without maven)

share|improve this answer

One possible way is to include an init script to your AMI, that checks out codes from your repo.

See how to do this on debian/ubuntu distribution.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.