Skip to content

Commit bfc2ad6

Browse files
committed
Updated sourcemap info for sentry-cli
1 parent bf06993 commit bfc2ad6

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/sourcemaps.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ sourcemaps) within Sentry. This removes the requirement for them to be
7676
web-accessible, and also removes any inconsistency that could come from
7777
network flakiness (on either your end, or Sentry's end).
7878

79+
You can either interact with the API directly or you can upload sourcemaps
80+
with the help of the Sentry CLI (:ref:`upload-sourcemaps-with-cli`_).
81+
7982
* Start by creating a new authentication token under **[Account] > API**.
8083
* Ensure you you have ``project:write`` selected under scopes.
8184
* You'll use the Authorization header with the value of ``Bearer: {TOKEN}``
@@ -149,6 +152,30 @@ will not show any contextual source.
149152
Additional information can be found in the `Releases API documentation
150153
<https://docs.getsentry.com/hosted/api/releases/>`_.
151154

155+
.. _upload-sourcemaps-with-cli:
156+
157+
Using Sentry CLI
158+
----------------
159+
160+
You can also use the Sentry :ref:`sentry-cli` to manage releases and
161+
sourcemaps on Sentry. If you have it installed you can create releases
162+
with the following command::
163+
164+
$ sentry-cli releases -o MY_ORG -p MY_PROJECT new 2da95dfb052f477380608d59d32b4ab9
165+
166+
After you have run this, you can use the `files` command to automatically
167+
add all javascript files and sourcemaps below a folder. They are
168+
automatically prefixed with a URL or your choice::
169+
170+
$ sentry-cli releases -o MY_ORG -p MY_PROJECT files \
171+
2da95dfb052f477380608d59d32b4ab9 upload-sourcemaps --url-prefix
172+
https://mydomain.invalid/static /path/to/assets
173+
174+
All files that end with `.js` and `.map` below `/path/to/assets` are
175+
automatically uploaded to the release `2da95dfb052f477380608d59d32b4ab9`
176+
in this case. If you want to use other extensions you can provide it with
177+
the ``--ext`` parameter.
178+
152179
.. sentry:edition:: hosted
153180
154181
Working Behind a Firewall

0 commit comments

Comments
 (0)