【问题标题】:Circle ci 2. sentry-cli can't find find dist folder to upload source mapsCircle ci 2. sentry-cli 找不到 find dist 文件夹上传源图
【发布时间】:2018-04-05 11:45:35
【问题描述】:

我有一个使用 web pack 的 Reactjs web 项目。当我进行产品构建时,会创建一个包含源映射的 dist 文件夹。然后每次我创建一个新标签时,我都会在 Sentry 中创建一个新版本。但是circle在docker镜像中找不到dist文件夹,这意味着circle构建失败。

  - run:
      name: Install sentry-cli
      command: curl -sL https://sentry.io/get-cli/ | bash

  - run:
      name: Create new sentry release from latest tag
      command: sentry-cli releases -o my-org -p my-project new ${CIRCLE_TAG/v/}

  - run:
      name: Upload Source Maps to sentry
      command: sentry-cli releases -o my-org -p my-project files ${CIRCLE_TAG/v/} upload-sourcemaps ./dist

我在将新标签推送到 docker 后运行此程序,但出现此错误。

error: ./dist: IO error for operation on ./dist: No such file or directory (os error 2)
Exited with code 1

我怎样才能访问包含源映射的 dist 文件夹?

【问题讨论】:

    标签: docker sentry circleci-2.0


    【解决方案1】:

    我不确定您的项目是如何设置的 - 但通常 dist 文件夹位于 .gitignore 中,并且未上传到 GIT,因此在 CI 中不可用。

    如果您在 CI 上构建应用程序,则 dist 文件夹将可用。我假设您的构建命令是 npm run build,但它也可能是 yarn build 或您用于构建应用程序的任何自定义命令。

    - run:
        name: Build react application
        command: npm run build
    
    - run:
        name: Install sentry-cli
        command: curl -sL https://sentry.io/get-cli/ | bash
    
    - run:
        name: Create new sentry release from latest tag
        command: sentry-cli releases -o my-org -p my-project new ${CIRCLE_TAG/v/}
    
    - run:
        name: Upload Source Maps to sentry
        command: sentry-cli releases -o my-org -p my-project files ${CIRCLE_TAG/v/} upload-sourcemaps ./dist
    

    【讨论】:

      猜你喜欢
      • 2020-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-17
      • 2019-02-28
      • 2017-11-12
      • 1970-01-01
      • 2022-01-16
      相关资源
      最近更新 更多