I now seem to have an answer to my question.
aws.push is not only for PHP applications, but can also be used to deploy Java and PHP applications. I have successfully used it with Apache Ant , and the setup works fine in our UAT environment.
I developed a shell script that does the following:
- Check the source code from the subversion repository.
- Create and create a WAR file using Apache Ant
- Exploding a WAR file into a git repository (initialized with Amazon EB)
- Add the exploded files to the git repository and commit the changes.
- Use aws.push to deploy the war file in EB.
(I do not have access to the shell script right now, so I can not provide detailed commands)
Here is the shell script in the main form
source_dir="/home/libregeek/myapp" workingcopy="$source_dir/trunk" gitrepo="$source_dir/gitrepo" cd $workingcopy svn update ant createwar cd $gitrepo unzip -o $workingcopy/build/myapp.war git add * git commit -m "Deployed new version" git aws.push
A known issue with this script is related to obsolete class files. To get rid of it, you will have to empty the git repository.
Here is the ant target:
<target name="createwar" depends="build" description="Create WAR file for deployment"> <war destfile="${alternate.path}/${name}.war" webxml="${web.dir}/WEB-INF/web.xml"> <fileset dir="${web.dir}"> <include name="**/*.*"/> </fileset> </war> </target>
source share