Alex
Alex

Reputation: 855

Controlling Which GIT Branch is Deployed to AWS ElasticBeanstalk via Eclipse Plugin

I'm using GIT and the feature-branch workflow for my local development. I'm also using the AWS SDK / Eclipse plugin for my application deployments to my ElasticBeanstalk Tomcat server. Recently I encountered a problem where new Java classes I had added to my codebase were not being deployed to ElasticBeanstalk (i.e., the compiled class files were not being uploaded into the remote Tomcat deployment directory).

After some investigation, I found that the plugin seems to be using this jar as part of the deployment process:

/eclpise installation path/plugins/com.amazonaws.eclipse.elasticbeanstalk_1.0.0.v201310211406/lib/jgit/jgit-1.3.0-aws-git-push.jar

But I couldn't find any settings in Eclipse that specify which GIT branch should be chosen for the deployment.

Eventually I solved my problem by deleting local and remote staging directories and unchecking the "incremental deployment" checkbox in my ElasticBeanstalk environment configuration within Eclipse, but I would like to understand better how the plugin chooses which files to be deployed so I can avoid this mess in the future.

Upvotes: 1

Views: 294

Answers (1)

Jason Fulghum
Jason Fulghum

Reputation: 1045

the Eclipse tools use a Git repository to deploy incremental changes to AWS Elastic Beanstalk, but they don't use the same Git repo as the one that you're using to manage your source code. Because the Eclipse toolkit needs to deploy the compiled artifacts to AWS Elastic Beanstalk, it manages a separate locate Git repo just for those compiled artifacts. The repo has the structure of an exploded WAR file. You can find this repo under Eclipse's .metadata directory if you really want to see it.

So, the short answer is... Eclipse should be deploying whatever code you have in your workspace. If you've switched to a specific branch in your source code Git repo, then it should be deploying that code. You might also check out the Deployment Assembly properties for your project. These describes how to convert your web project into a WAR file, and it's exactly what the Eclipse toolkit is using to compile your project before it pushes it to AWS Elastic Beanstalk. Let us know if that still doesn't line up with the behavior you're seeing, and we can try to debug any other problems you're having.

Upvotes: 2

Related Questions