Define Sentry application environment

This commit is contained in:
wpetit 2019-02-14 09:15:37 +01:00
parent 8043745423
commit a2bb22f532
3 changed files with 6 additions and 2 deletions

View File

@ -1,2 +1,3 @@
SENTRY_DSN=
MAPBOX_ACCESS_TOKEN=
MAPBOX_ACCESS_TOKEN=
ENVIRONMENT=development

1
Jenkinsfile vendored
View File

@ -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

View File

@ -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';