Define Sentry application environment
This commit is contained in:
parent
8043745423
commit
a2bb22f532
|
@ -1,2 +1,3 @@
|
|||
SENTRY_DSN=
|
||||
MAPBOX_ACCESS_TOKEN=
|
||||
MAPBOX_ACCESS_TOKEN=
|
||||
ENVIRONMENT=development
|
|
@ -48,6 +48,7 @@ pipeline {
|
|||
cp .env.dist .env
|
||||
sed -i "s|^SENTRY_DSN=.*|SENTRY_DSN=${SENTRY_DSN}|" .env
|
||||
sed -i "s|^MAPBOX_ACCESS_TOKEN=.*|MAPBOX_ACCESS_TOKEN=${MAPBOX_ACCESS_TOKEN}|" .env
|
||||
sed -i "s|^ENVIRONMENT=.*|ENVIRONMENT=production|" .env
|
||||
|
||||
# Create Sentry release properties
|
||||
cp android/sentry.properties.dist android/sentry-release.properties
|
||||
|
|
4
index.js
4
index.js
|
@ -1,10 +1,12 @@
|
|||
/** @format */
|
||||
|
||||
import { Sentry } from 'react-native-sentry';
|
||||
import { SENTRY_DSN } from 'react-native-dotenv';
|
||||
import { SENTRY_DSN, ENVIRONMENT } from 'react-native-dotenv';
|
||||
|
||||
Sentry.config(SENTRY_DSN).install();
|
||||
|
||||
Sentry.setTagsContext({environment: ENVIRONMENT});
|
||||
|
||||
import {AppRegistry} from 'react-native';
|
||||
import App from './src/app';
|
||||
import {name as appName} from './app.json';
|
||||
|
|
Loading…
Reference in New Issue