I currently have a Lambda's API Gateway repository in CodeCommit that I successfully build using esbuild with CLI (SAM BUILD and then SAM DEPLOY).
Now, I am looking to streamline the building process by integrating it with CodePipeline. I started experimenting with CodeBuild, but encountered an error when running the build:
File "/root/.pyenv/versions/3.9.5/lib/python3.9/site-packages/samcli/lib/build/workflow_config.py", line 133, in get_selector raise UnsupportedBuilderException("'{}' does not have a supported builder".format(specified_workflow)) samcli.lib.build.workflow_config.UnsupportedBuilderException: 'esbuild' does not have a supported builder
This is what my template Lambda function looks like: (I removed the properties for clarity)
BasicFunction:
Type: AWS::Serverless::Function
Properties:
Metadata:
BuildMethod: esbuild
BuildProperties:
Minify: false
Target: "es2020"
EntryPoints:
- appBasic.ts
Here is my buildspec.yml configuration:
version: 0.2
phases:
install:
commands:
- npm install
- npm install esbuild
build:
commands:
- sam build
- sam deploy --no-confirm-changeset --no-fail-on-empty-changeset