Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Final cleanup, added README

  • Loading branch information...
commit d1ad6f76c3508c1a8508642385557797b960e7f0 1 parent 9053f72
@jeppenejsum authored
Showing with 37 additions and 8 deletions.
  1. +25 −0 README
  2. +12 −8 build.gradle
View
25 README
@@ -0,0 +1,25 @@
+This is the source for the article series "EC2 Continuous Deployment: Hello world" located at
+
+http://jeppenejsum.wordpress.com/2009/05/03/ec2-continuous-deployment-hello-world/
+
+
+The files contain a complete end-to-end example for doing continuous deployment:
+
+ - Building a Lift webapp with Gradle (Need Gradle with the Scala plugin)
+ - Launch new EC2 instance
+ - Configure & Deploy EC2 instance using Chef
+ - Run simple integration test
+ - Shutdown EC2 instance
+
+You need to enter your Amazon AWS credentials in the top of build.gradle in order to try the examples.
+
+If this is done, you can type
+
+gradle integrationTest
+
+to build, deploy and test the webapp.
+
+
+Feel free to comment. Enjoy!
+
+/Jeppe Nejsum Madsen
View
20 build.gradle
@@ -140,12 +140,16 @@ createTask('testDeploy', dependsOn:['libs','createInstance']) {
// Very simple integration test :-)
createTask('integrationTest', dependsOn: 'testDeploy') {
- client = new org.apache.commons.httpclient.HttpClient()
- method = new org.apache.commons.httpclient.methods.GetMethod("http://$createInstance.dnsName/")
- client.executeMethod(method)
- def s = method.responseBodyAsString
- if (s.indexOf("Welcome to the final helloworld project!") < 0) {
- println s
- throw new RuntimeException("Test failed")
- }
+ try {
+ client = new org.apache.commons.httpclient.HttpClient()
+ method = new org.apache.commons.httpclient.methods.GetMethod("http://$createInstance.dnsName/")
+ client.executeMethod(method)
+ def s = method.responseBodyAsString
+ if (s.indexOf("Welcome to the final helloworld project!") < 0) {
+ println s
+ throw new RuntimeException("Test failed")
+ }
+ } finally {
+ ec2.terminateInstances([createInstance.instanceId])
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.