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.
|
normalizeDepth: 10, // Or however deep you want your state context to be.
|
||||||
environment: "prod",
|
environment: "prod",
|
||||||
// release : '1'
|
// release : '1'
|
||||||
|
release: __SENTRY_RELEASE__
|
||||||
});
|
});
|
||||||
|
|
||||||
const pinia = createPinia()
|
const pinia = createPinia()
|
||||||
|
@ -6,9 +6,21 @@ import graphql from '@rollup/plugin-graphql';
|
|||||||
import { viteRequire } from 'vite-require'
|
import { viteRequire } from 'vite-require'
|
||||||
import svgLoader from 'vite-svg-loader'
|
import svgLoader from 'vite-svg-loader'
|
||||||
import { sentryVitePlugin } from "@sentry/vite-plugin";
|
import { sentryVitePlugin } from "@sentry/vite-plugin";
|
||||||
|
import { execSync } from 'child_process'
|
||||||
|
|
||||||
require('dotenv').config();
|
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/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [vue({
|
plugins: [vue({
|
||||||
@ -23,7 +35,8 @@ export default defineConfig({
|
|||||||
project: "atlas-atterrissage.com",
|
project: "atlas-atterrissage.com",
|
||||||
authToken: process.env.AUTH_TOKEN,
|
authToken: process.env.AUTH_TOKEN,
|
||||||
release: {
|
release: {
|
||||||
name: "ouatterrir",
|
// name: "ouatterrir",
|
||||||
|
name: release
|
||||||
},
|
},
|
||||||
url: "https://frontlog.figli.io",
|
url: "https://frontlog.figli.io",
|
||||||
})
|
})
|
||||||
@ -58,4 +71,7 @@ export default defineConfig({
|
|||||||
esbuild: {
|
esbuild: {
|
||||||
drop: ['console', 'debugger'],
|
drop: ['console', 'debugger'],
|
||||||
},
|
},
|
||||||
|
define: {
|
||||||
|
__SENTRY_RELEASE__: JSON.stringify(release),
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user