【问题标题】:Error 404 KeyNotFound and missing files git - s3 deployment错误 404 KeyNotFound 和缺少文件 git - s3 部署
【发布时间】:2020-06-30 21:42:16
【问题描述】:

所以我们正忙于一个 uni 项目,我已经使用 aws codePipeline、Github、CodeBuild 等设置了自动化部署。

我终于在构建阶段使用了我的构建规范,并且部署也成功了。但是我在访问 url 时收到错误 404 Keynotfound。

当我转到存储桶内容时,这就是我发现的。它只是类型文件的东西。角度文件不在这里。

有什么帮助吗?

这是我的构建规范代码:


phases:
  install:
    commands:
      - echo installing nodejs...
      - curl -sL https://deb.nodesource.com/setup_12.x | bash -
      - apt-get install -y nodejs
      - echo installing yarn...
      - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
      - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
      - apt install --no-install-recommends yarn
  pre_build:
    commands:
      - echo installing dependencies...
      - npm i -g @angular/cli
      - npm install
  build:
    commands:
      # - echo testing...
      # - echo building...
      - ng build --prod
artifacts:
  files:
    - "**/*"
  discard-paths: no
  base-directory: dist/ ```

【问题讨论】:

  • 我在代码构建中没有看到对 s3 的任何调用?由于缺少密钥,它在哪里出错?
  • 在我设置了静态网站访问的存储桶后,我转到 url 我得到 404 NotFound Code: NoSuchKey Message: The specified key does not exist.

标签: git amazon-web-services amazon-s3


【解决方案1】:

发现问题。

我不得不勾选一个文本框,上面写着在部署阶段构建后解压缩并且它起作用了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-17
    • 1970-01-01
    • 2021-12-29
    • 2022-11-01
    • 1970-01-01
    相关资源
    最近更新 更多