阅读背景:

AWS CodeBuild在转移到S3步骤时将FOREVER取消

来源:互联网 

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

我为一个相当简单的构建管道构建了一个CodeBuild项目。我正在构建一个NodeJS项目。我的buildspec非常简单:

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.

npm运行构建步骤只是使用Babel将代码转换为src / dist目录。我正在运行一个构建版,它已经过了37分钟而且它仍在构建,在步骤UPLOAD_ARTIFACTS上。我可以看到正在添加到S3存储桶的工件,所以它可能实际上仍然在做东西。

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?

我有什么办法可以改进这个构建过程吗?这应该是我想的最短5分钟的任务。我是否通过将node_modules上传到S3存储桶做错了什么?

What is the best configuration for a Node project?

Node项目的最佳配置是什么?

1 个解决方案

#1


1  

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.

CodeBuild项目的“Artifacts包装”配置是否设置为“None”?将打包更改为“Zip”可能会快得多,因此构建不会花费时间将每个单独的节点模块文件上载到S3。而不是使用zip包装,CodeBuild将拉上所有内容并将一个zip文件上传到S3。

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

此页面包含有关在CodeBuild控制台中查找打包设置的位置的说明:http://docs.aws.amazon.com/codebuild/latest/userguide/change-project.html


分享到: