amazon-web-services - 如何修复 AWS 代码构建 apt-get 更新退出状态 100 以便 react 应用程序上传到 s3

标签 amazon-web-services aws-codebuild

我有 reactJs 应用程序并使用 AWS s3 来部署静态站点。我已经为 CI/CD 设置了 AWS 代码构建。我正在使用 bitbucket,当任何 PR 合并到 master 分支时,Web-hook 出现在 s3 上触发 react 应用程序构建和上传构建。
它在过去 2 年中运行良好,但在上次构建中出现以下错误。

W: GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures were invalid: EXPKEYSIG 23E7166788B63E1E Yarn Packaging yarn@dan.cx E: The repository 'https://dl.yarnpkg.com/debian stable InRelease' is not signed.

[Container] 2021/02/04 07:39:02 Command did not exit successfully apt-get update exit status 100 [Container] 2021/02/04 07:39:02 Phase complete: INSTALL State: FAILED [Container] 2021/02/04 07:39:02 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: apt-get update. Reason: exit status 100


这是完整的日志输出。
enter image description here
这是buildspec.yml文件
# aws codebuild for React and deployment to S3
version: 0.2
phases:
  install:
    runtime-versions:
      nodejs: 10
    commands:
      - echo Installing build dependencies...
      - apt-get update
      - apt-get install -y sshpass zip unzip
  pre_build:
    commands:
      - echo Build started on `date`
      - echo Installing source NPM dependencies...
      - npm ci
      - cp src/gatsby-overrides/gatsby-sharp.js node_modules/gatsby-plugin-sharp/index.js
      - cp src/gatsby-overrides/gatsby-image.js node_modules/gatsby-image/index.js
  build:
    commands:
      - npm run build
      - chmod u+x script.sh
      - ./script.sh
    finally:
      - echo Build completed on `date`
cache:
  paths:
    - 'public/**/*'

最佳答案

它在第 82 行提示的签名 key ,在 apt update 之前安装它会发生什么?喜欢这里的建议:https://github.com/yarnpkg/yarn/issues/7866

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -

关于amazon-web-services - 如何修复 AWS 代码构建 apt-get 更新退出状态 100 以便 react 应用程序上传到 s3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66048285/

相关文章:

amazon-web-services - 如何强制使 CodeBuild (AWS) 失败?

amazon-web-services - 将自定义指标添加到 CloudFormation 模板

php - AWS 亚马逊 SES 突然停止工作

amazon-web-services - 在AWS CodeBuild中创建新项目时,收到“未授权执行DescribeSecurityGroups”

amazon-web-services - 在 CodeBuild Docker 镜像之上构建 Docker 镜像

aws-codebuild - 创建 AWS Codebuild 存储库时出现 "Repository not found or permission denied"

amazon-web-services - fargate ECS 任务公共(public) IP 地址是否有限制?

ruby-on-rails - 在 AWS 上水平扩展的重型 RoR 应用程序需要高效的 SSL

Android aws cognito 登录 token 无效。不是 Cognito token

amazon-web-services - Aws - 使用 oom javascript 构建失败