Play Framework deployment on Elastic Beanstalk

Posted on October 7, 2014

Riffing on a previous post about doing continuous deployment to Elastic Beanstalk, I just did a setup to get Play Framework to deploy to Elastic Beanstalk.

Basically, the crux of it is to use a plugin that builds WAR files for Play. To accomplish this, I used The plugin has you update the version number and it builds the WAR based on that name, but that gets weird for doing deployment from the same location. I modified the instructions and used this in build.sbt:

version := "latest"

After that, it was just running the following:

sbt war
pip install awscli
aws s3 cp project-latest.war s3://BUCKET/PATH/git-`git rev-parse --short HEAD`.zip --region "REGION"
aws elasticbeanstalk create-application-version --application-name "APPLICATION NAME" --version-label `git rev-parse --short HEAD` --source-bundle S3Bucket="BUCKET",S3Key="PATH/git-`git rev-parse --short HEAD`.zip"  --region "REGION"
aws elasticbeanstalk update-environment --environment-name "ENVIRONMENT NAME" --version-label `git rev-parse --short HEAD`  --region "REGION"

And that’s really it.

2 responses to “Play Framework deployment on Elastic Beanstalk”

  1. David Maple says:

    There’s now a better way to deploy Playframework apps to Elastic Beanstalk using the Java SE containers. Here’s a tutorial that walks you through preparing your Play! app for deployment using the standard “`activator dist“` command:

  2. Хай… Я просто хотел сказать, что информация, представленная на вашем интернет-сайте – просто превосходна;) Я обязательно вернусь на
    вашу страницу в обозримом будущем;)

Leave a Reply

Your email address will not be published. Required fields are marked *