added commit hash as release name in sentry vitejs config
This commit is contained in:
parent
77640c9d16
commit
3e25f8c678
@ -38,6 +38,7 @@ Sentry.init({
|
||||
normalizeDepth: 10, // Or however deep you want your state context to be.
|
||||
environment: "prod",
|
||||
// release : '1'
|
||||
release: __SENTRY_RELEASE__
|
||||
});
|
||||
|
||||
const pinia = createPinia()
|
||||
|
@ -6,9 +6,21 @@ import graphql from '@rollup/plugin-graphql';
|
||||
import { viteRequire } from 'vite-require'
|
||||
import svgLoader from 'vite-svg-loader'
|
||||
import { sentryVitePlugin } from "@sentry/vite-plugin";
|
||||
import { execSync } from 'child_process'
|
||||
|
||||
require('dotenv').config();
|
||||
|
||||
// Get short Git commit hash
|
||||
function getGitCommitHash() {
|
||||
try {
|
||||
return execSync('git rev-parse --short HEAD').toString().trim()
|
||||
} catch (e) {
|
||||
console.warn('Could not retrieve Git commit hash')
|
||||
return 'unknown'
|
||||
}
|
||||
}
|
||||
const release = `ouatterrir@${getGitCommitHash()}`
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue({
|
||||
@ -23,7 +35,8 @@ export default defineConfig({
|
||||
project: "atlas-atterrissage.com",
|
||||
authToken: process.env.AUTH_TOKEN,
|
||||
release: {
|
||||
name: "ouatterrir",
|
||||
// name: "ouatterrir",
|
||||
name: release
|
||||
},
|
||||
url: "https://frontlog.figli.io",
|
||||
})
|
||||
@ -58,4 +71,7 @@ export default defineConfig({
|
||||
esbuild: {
|
||||
drop: ['console', 'debugger'],
|
||||
},
|
||||
define: {
|
||||
__SENTRY_RELEASE__: JSON.stringify(release),
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user