AWS CodeBuild taking FOREVER on transfer to S3 step

Viewed 1025

I built a CodeBuild project for a fairly simple build pipeline. I am building a NodeJS project. My buildspec is pretty simple:

version: 0.2
env:
  variables:
    ENVIRNOMENT: "AWSDEV"
phases:
  pre_build:
    commands:
      - npm install
  build:
    commands:
      - npm run -s build
artifacts:
  files:
    - src/dist/**/*
    - node_modules/**/*
  discard-paths: no

The npm run build step simply uses Babel to transpile the code into the src/dist directory. I'm running a build and it's been 37 minutes and it's still building, on the step UPLOAD_ARTIFACTS. I can see the artifacts being added to the S3 bucket so it's presumably actually still doing stuff.

Is there anything I can do to improve this build process? This should be a short, 5 minute at most task I would think. Am I doing something wrong by uploading node_modules to the S3 bucket?

What is the best configuration for a Node project?

1 Answers

Is the "Artifacts packaging" configuration set to "None" for your CodeBuild project? Changing the packaging to "Zip" will probably be much faster, so that the build doesn't take time uploading each individual node module file to S3. Instead with zip packaging, CodeBuild will zip everything up and upload one zip file to S3.

This page contains instructions on where to find the packaging setting in the CodeBuild console: http://docs.aws.amazon.com/codebuild/latest/userguide/change-project.html

Related