Reputation: 11946
Is it possible to upload a Java Elastic Beanstalk application through the command line tools for EB?
I know that I can upload my application to EB via the web console (uploading the WAR file) or by using AWS's instructions for Eclipse. However, I also want to see if I can use the AWS DevTools to upload updates to my app to EB. I have already used the eb command-line tool to create and configure my git repository for my application, so I can use the git aws.push
command. However, no matter what I try (push my entire workspace, push a repo with just the war file, push a repo with the contents of the exploded war file contents as described in this blog post), it never works. A .zip file is uploaded to Beanstalk and my application becomes unhealthy.
I began to wonder if git aws.push
is only available for PHP apps and not Java, since PHP is the only language mentioned in AWS's documentation for the DevTools. Anyone have any idea if git aws.push
is available for Java apps?
BTW, I should mention that my .war file was created by using mvn clean install
, since my application uses a Maven-based workspace. I am aware of the Maven Beanstalker Plugin that I could possibly use for uploading the app to Beanstalk, but nonetheless, I still want to see if git aws.push
is available to me.
Related SOF post: Deploying Java web application to Amazon Elastic Beanstalk
Upvotes: 4
Views: 1710
Reputation: 3619
AWS Elastic Beanstalk expect Zip Files (and war files are zip files) containing the source files (when using scripting languages) or binary content (.NET and Java) as Available Versions
Beanstalker takes advantage to this via fast-deploy, which takes the war file contents (from target/${build.finalName}), copies to a temporary directory (tmp-git-staging), then calls the AWS EB Endpoints. It is notably reliable, even if AWS itself didn't document the interface.
It picks up, builds a .s3 file and optionally calls an UpdateEnvironment to this new version label.
RE aws.push:
aws.push creates an URL to an authenticated AWS EB endpoint for git, and then calls git push. The code to use is similar to this one
Upvotes: 1