I’ve recently started using Codeship – a cloud based Continuous Integration and Deployment environment – for a “Just for fun” project I needed to deploy to AWS, specifically to Elastic Beanstalk. At the time of this writing, there were no AWS plugins available on Codeship to make this deployment possible but, thanks to one of their Engineers (thanks you Florian), I was able to make it happen using the “Custom Script” option on Codeship, and the “ebs_deploy” tool by Brian Dilley.
As per the docs of Ebs Deploy, I added a “ebs.config” file in my repository that contains details about my AWS settings, my Elastic Beanstalk app settings and my environments. It also contains a section defining the type of file I want uploaded as well as the command the would build that file.
|description: 'My App Description'|
|solution_stack_name: '64bit Amazon Linux running Tomcat 7'|
|Application Healthcheck URL: '/'|
|# instructions on how to build the application archive|
|cmd: sbt package|
|# the Testing version of the app|
|# the production version of the app|
With that added, I changed my deployment setting on my project in Codeship to use the “Custom Script” option, and entered the following commands
|pip install ebs-deploy|
|ebs-deploy deploy –environment muzzy-app-dev|
The first command ensures that Ebs Deploy is present on my environment. The second initialize my environments based on the ebs.config, which can be useful should I change/add new environments to that file. Finally, the third command does the actual deployment.
Et voila! I hope this helps!