2

My team is developing a Java application which is to be deployed on Google App Engine(GAE). Currently we use the eclipse-plugin to build and deploy the code in GAE.

However, I would like to automate(by using cron or svn-post-commit hook) this process so that the source code in subversion trunk is automatically deployed in GAE before each scrum meeting. I hope this would eventually reduce the load on our programmers and help them to focus more on the application logic.

Please let me know if this is possible with Java+GAE+Subversion

thanks in advance

libregeek
  • 1,264
  • 11
  • 23
  • I wouldn't recommend an automated deploy. There might always be a commit which shouldn't have been deployed.. – Gaurav Shah Aug 23 '11 at 07:15
  • 2
    I did a small script to automatically deploy to GAE. This script updates a working copy, build the app and deploy it in GAE using Ant. It will also send an email to the developers with all the information collected during the process. I used the build.xml provided in Ant documentation in GAE. – libregeek Aug 24 '11 at 06:04

3 Answers3

4

It is possible. This is what I did with my project. I should also note that this question is similar with another stackoverflow question in Possible to integrate Google AppEngine and Google Code for continuous integration? and it provides several good answer that you could use.

That being said, my personal approach is to set up ant build for the eclipse project, and use Jenkins to automatically update the code from Subversion and build them up using the ant build.

You could then add a target using appcfg and macro provided by google to upload your built project to Google App Engine. More details of using Ant on Google App Engine could be seen in here.

A bonus point of using continuous integration tools such as Jenkins is that you could add automated unit testing using JUnit or your personal testing flavor. It will save your team lots of headaches in the long run.

Community
  • 1
  • 1
Ibrahim Arief
  • 8,742
  • 6
  • 34
  • 54
2

I used python for GAE and there is a appcfg.py script with which one can deploy the code with one command as -

python appcfg.py update

This makes me think that for Java as well there must be some script from Google to deploy applications. If there is one, then what you are trying to do must be a simple command which be used a cron job.

Siddharth
  • 5,009
  • 11
  • 49
  • 71
  • Infact there is a script to deploy it from the command line. Look here: http://code.google.com/appengine/docs/java/gettingstarted/uploading.html Under "Uploading your application" -> "Uploading using the Command Prompt" – Siddharth Aug 23 '11 at 07:15
  • The eclipse plugin includes the appcfg.sh script. But I'm not sure whether it can be executed without eclipse. Does Google provides a deploy script which is not dependent on eclipse? – libregeek Aug 23 '11 at 07:20
  • thanks @siddharth. I think I need to check this: http://code.google.com/appengine/docs/java/tools/ant.html – libregeek Aug 23 '11 at 07:27
1

Your team should use a Continuous Integration tool, e.g. Jenkins. This will solve your next problems too, which you may not thought over: it can be configured to run unit and integration tests before deployment. It has many options for version control system integration.

pcjuzer
  • 2,724
  • 4
  • 25
  • 34
  • Thanks @pcjuzer for your suggestion. We are considering Hudson and Junit for testing & CI. But since coding is just started, I have to wait for the test cases. BTW, is there any subtle difference between Hudson & Jenkins? – libregeek Aug 24 '11 at 05:59
  • I don't know too much about the Hudson->Jenkins story but most projects I see changed to Jenkins. It's OK to use Jenkins without test cases. The main point that you wire in your build-, test-, or deployment script into the CI tool and it executes them even for each SVN commit. (However, it's not the best solution.) And the whole thing runs on one server, one environment. So, no matter if developer A or B has some different version of something on their desktop and the release built by A or B may have tiny diffs. Another thing that it has a web-GUI with many useful info about executed scripts. – pcjuzer Aug 24 '11 at 06:26