未验证 提交 919ac17f 编写于 作者: C Ciprian Caba 提交者: GitHub

Update reference to commit sha (#23215)

VERCEL_GIT_COMMIT_SHA is now available by default across all integrations
上级 32c435d8
......@@ -63,7 +63,7 @@ You will need to install and configure the [Sentry Vercel integration](https://d
1. Set up the `NEXT_PUBLIC_SENTRY_DSN` environment variable as described above.
2. Save your Sentry organization slug as the `SENTRY_ORG` environment variable and your project slug as the `SENTRY_PROJECT` environment variable in `.env.local`.
3. Save your git provider's commit SHA as either `VERCEL_GITHUB_COMMIT_SHA`, `VERCEL_GITLAB_COMMIT_SHA`, or `VERCEL_BITBUCKET_COMMIT_SHA` environment variable in `.env.local`.
3. Save your git provider's commit SHA as `VERCEL_GIT_COMMIT_SHA` environment variable in `.env.local`.
4. Create an auth token in Sentry. The recommended way to do this is by creating a new internal integration for your organization. To do so, go into **Settings > Developer Settings > New internal integration**. After the integration is created, copy the Token.
5. Save the token inside the `SENTRY_AUTH_TOKEN` environment variable in `.env.local`.
6. Set `NEXT_PUBLIC_SENTRY_SERVER_ROOT_DIR` to the absolute path of the folder the Next.js app is running from
......
......@@ -6,16 +6,9 @@ const {
SENTRY_PROJECT,
SENTRY_AUTH_TOKEN,
NODE_ENV,
VERCEL_GITHUB_COMMIT_SHA,
VERCEL_GITLAB_COMMIT_SHA,
VERCEL_BITBUCKET_COMMIT_SHA,
VERCEL_GIT_COMMIT_SHA,
} = process.env
const COMMIT_SHA =
VERCEL_GITHUB_COMMIT_SHA ||
VERCEL_GITLAB_COMMIT_SHA ||
VERCEL_BITBUCKET_COMMIT_SHA
process.env.SENTRY_DSN = SENTRY_DSN
const basePath = ''
......@@ -25,7 +18,7 @@ module.exports = {
// Make the COMMIT_SHA available to the client so that Sentry events can be
// marked for the release they belong to. It may be undefined if running
// outside of Vercel
NEXT_PUBLIC_COMMIT_SHA: COMMIT_SHA,
NEXT_PUBLIC_COMMIT_SHA: VERCEL_GIT_COMMIT_SHA,
},
webpack: (config, options) => {
// In `pages/_app.js`, Sentry is imported from @sentry/browser. While
......@@ -66,7 +59,7 @@ module.exports = {
SENTRY_ORG &&
SENTRY_PROJECT &&
SENTRY_AUTH_TOKEN &&
COMMIT_SHA &&
VERCEL_GIT_COMMIT_SHA &&
NODE_ENV === 'production'
) {
config.plugins.push(
......@@ -75,7 +68,7 @@ module.exports = {
ignore: ['node_modules'],
stripPrefix: ['webpack://_N_E/'],
urlPrefix: `~${basePath}/_next`,
release: COMMIT_SHA,
release: VERCEL_GIT_COMMIT_SHA,
})
)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册