0

I have a Reactjs web project where I use web pack. When I do a prod build a dist folder is created with source map in it. Then every time I create a new tag I create a new release in Sentry. But circle can't find the dist folder inside the docker image which means circle build fails.

  - 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

I run this after a new tag has been pushed to docker but I get this error.

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

how can I make can access my dist folder with source maps in it?

user3476614
  • 537
  • 2
  • 8
  • 26

1 Answers1

2

I'm unsure of how your project is setup - but usually the dist folder is in the .gitignore and not uploaded to GIT and as such isn't available in the CI.

If you build the app on the CI then the dist folder will become available. I've assumed your build command is npm run build but it could also be yarn build or any custom command you use to build your application.

- 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
sketchthat
  • 2,678
  • 2
  • 13
  • 22