Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

[Feature Request]: Rework the build process #81

@AnnaDodson

Description

@AnnaDodson

Contact Details

No response

Feature Request

Currently, the build creates a zip and it's named using hardcoded values and the commit hash is appended to the end:

module.exports = env => {
  let commit = env ? env.commit ? env.commit : 'local' : 'local' ;
  return merge(common, {
    mode: 'production',
    plugins: [
      new BundlePlugin({
        archives: [
          {
            inputPath: `.aws-sam/build/${LAMBDA_NAME}`,
            outputPath: `${OUTPUT_FOLDER}`,
            outputName: `${REPO_NAME}-${BRANCH_NAME}-${commit}`,
          }
        ],
      }),
    ],
  });

See webpack production file.

It would be better if the zip files were created from the function names specified in the SAM template.yaml and then multiple lambdas can be named in one go. For example, something like:

function getArchives() {
	return template.lambdas.map((lambdaName) => ({
		inputPath: `.aws-sam/build/${lambdaName}`,
		outputPath: `${OUTPUT_FOLDER}`,
		outputName: `${lambdaName}`,
	}));
}

Then any branch name specifiers or tags can be added through the GitHub actions.

Are you currently using a workaround / alternative solution instead?

See RSP build for example using an imported JSON file containing the lambda function names (as file names needed to be different to function names in this case):

https://github.com/dvsa/rsp-payments-service/blob/master/webpack.production.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions