我有 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
这是完整的日志输出。
这是
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/