4

I am developing an Elastic Beanstalk app. It is a Scala web application, built with sbt. I want to deploy the resulting WAR from the command line to an existing environment.

All I can find is the eb CLI which appears to require you to use git: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-getting-started.html

Is there not a way to simply specify a WAR and environment name to perform the deployment?

What is the best workaround otherwise? I can upload to S3 from the command line and then use the web app to choose that file, but it's a bit more painful than I wanted.

Dan Gravell
  • 7,855
  • 7
  • 41
  • 64

2 Answers2

10

You can use Elastic Beanstalk CLI (eb) instead of AWS CLI. Just run eb create to create a new environment and eb deploy to update your environment.

You can set specific artifact (your *.war file), by configuring the EB CLI (read: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html#eb-cli3-artifact):

You can tell the EB CLI to deploy a ZIP or WAR file that you generate as part of a separate build process by adding the following lines to .elasticbeanstalk/config.yml in your project folder.

deploy:   
  artifact: path/to/buildartifact.zip
Edward Samuel
  • 3,846
  • 1
  • 22
  • 39
  • Finally got to try this, thanks! It worked. I guess I was confused by all the front-loading of git into the documentation. – Dan Gravell Dec 04 '15 at 11:55
5

I found a way - use the aws CLI instead. First upload to S3 (I actually use s3cmd) then create an application version:

$ aws elasticbeanstalk create-application-version --application-name untaggeddb --version-label myLabel --source-bundle S3Bucket="bucketName",S3Key="key.war"

I believe the application version can then be deployed with update-environment also using the aws CLI.

Dan Gravell
  • 7,855
  • 7
  • 41
  • 64