Skip to content
This repository has been archived by the owner on Jul 2, 2019. It is now read-only.

Issue with Java war deployment #2

Open
stevenbeaullieu opened this issue Nov 28, 2017 · 0 comments
Open

Issue with Java war deployment #2

stevenbeaullieu opened this issue Nov 28, 2017 · 0 comments

Comments

@stevenbeaullieu
Copy link

I was unable to get this to work for a Java web application without some modifications. It seems as though the build step is specifically for node projects with no way to bypass it. I tried adding another option in ElasticBeanstalkPlugin.ts to only run the deploy step and it worked. Would you be able to incorprate this into the next version?

In defineCommands():

  'elastic-beanstalk-deploy': {
    lifecycleEvents: [
      'deploy',
    ],
    options: commonOptions,
    usage: 'Deploys the application to AWS ElasticBeanstalk',
  },

In defineHooks():

  'elastic-beanstalk-deploy:deploy': () => BPromise.bind(this)
    .then(deploy),

Also, the file attribute in the serverless.yml file is only honored for placing the deploy in S3, not for the actual file to deploy. In the build step, the filename is hard-coded to:

const fileName: string = `bundle-${versionLabel}.zip`;

It would be nice if the file attribute in the serverless.yml was used to specify the output file for the build, the file that should be deployed, and the S3 name of the file.

This would involve this update to build.ts:

const ebConfig: IPluginConfig = this.config;
let fileName = `bundle-${versionLabel}.zip`;

if (ebConfig.file) {
fileName = ebConfig.file.prefix ? `${ebConfig.file.prefix}/` : '';
fileName += ebConfig.file.name ? `${ebConfig.file.name}` : `bundle-${versionLabel}.zip`;
}

and this update to deploy.ts:

const bundlePath = path.resolve(this.artifactTmpDir, fileName);

With those changes this would work very well for my use case where I already have a war built with gradle and I'm just looking to deploy it.

Also, for my purposes, I didn't really get any value out of the stack-config.json file. It was really only an indirect reference to my applicationName and environmentName. For me it would be sufficient if I could just specify the applicationName and environmentName directly in serverless.yml.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants