IAmYourFaja
IAmYourFaja

Reputation: 56884

Google App Engine: How to perform a remote deploy to dev app server?

I am in the process of setting up a "QA environment" for my GAE app. This QA environment will simply be a small server on my home network with a dedicated IP address. I'm writing an Ant script to check the project out of my SVN repo, build it on my build server, and then deploy it "remotely" (across my home LAN) to the QA app server.

With Tomcat, I would just scp the web archive to the machine's webapps/ directory, and since it can be configured to hot-deploy, that is all I usually need for a QA deploy.

But I'm new to GAE, and so I'm not seeing how I can achieve such a remote deployment via Ant. The best I can think of (although somewhat convoluted) would be:

  1. Checkout and build the WAR on the buildserver, like I normally would
  2. scp the WAR to a staging directory, somewhere on the QA machine; say 192.168.1.55:/opt/gae/staging
  3. Have a lightweight RESTful web service running on that machine (maybe hosted by Tomcat or Jetty) listening for a client to hit a certain API, say http://192.168.1.55:8080/GaeRemoteApi/deploy; when the request handler gets a request for this URL, it kicks off a shell command to copy the WAR into the correct directory and then execute appcfg.sh -upload to actually deploy the WAR to my QA app server

I'm pretty sure I could get this working within a day or two, but was wondering if the GAE ships with an easier (baked in) solution; or if a fresh set of eyes can think of something even simpler. Thanks in advance!

Upvotes: 0

Views: 777

Answers (2)

chees
chees

Reputation: 595

I think you should just keep it simple:

Since you are on Ubuntu, you can write a shell script that will:

  1. ssh to the remote server
    • stop the current gae dev appserver
    • rename the existing war directory
  2. scp the new deployment to the QA server war directory
  3. ssh to the QA server and start the gae dev appserver

You can call a shell script from ant using: http://sumedha.blogspot.com.au/2008/06/how-to-call-shell-script-from-ant.html

To stop the dev appserver:

killall -e ./appengine-java-sdk/bin/dev_appserver.sh

To run the dev appserver:

nohup ./appengine-java-sdk/bin/dev_appserver.sh you/war/directory &

Upvotes: 1

dragonx
dragonx

Reputation: 15143

Run the development server?

https://developers.google.com/appengine/docs/java/tools/devserver

Upvotes: 1

Related Questions