This sample creates a CodePipeline pipeline that tests the lodash project using CodeBuild, then publishes the NPM package to CodeArtifact.
You must set CODEPIPELINE_GH_TOKEN environment config option to the PAT token. GitHub requires this to download archives of repositories.
Start LocalStack using any supported method, or:
docker run \
-it \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "./volume:/var/lib/localstack" \
-e DEBUG=1 \
-p 4566:4566 \
-p 4510-4559:4510-4559 \
-e DOCKER_HOST=unix:///var/run/docker.sock \
-e LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN} \
-e CODEPIPELINE_GH_TOKEN=${CODEPIPELINE_GH_TOKEN} \
localstack/localstack-pro:latest
Run the following script which will create all prerequisite resource and the pipeline. It will also download the published NPM package from CodeArtifact repository.
bash run.sh
The pipeline is structured as follows:
flowchart LR
A("CodeStarConnection: Download source code")
A --> B("CodeBuild: Test")
B --> C("CodeBuild: Publish to CodeArtifact")