Browse Source

include git revision in sentry & export file name

master
Gaëtan Renaudeau 6 years ago
parent
commit
17807e0a13
  1. 1
      .eslintrc
  2. 1
      flow-defs/globals.js
  3. 1
      scripts/release.sh
  4. 4
      src/components/ExportLogsBtn.js
  5. 1
      src/sentry/install.js
  6. 3
      webpack/plugins.js

1
.eslintrc

@ -8,6 +8,7 @@
"__TEST__": false,
"__PROD__": false,
"__SENTRY_URL__": false,
"__GIT_REVISION__": false,
"__PRINT_MODE__": false,
"__GLOBAL_STYLES__": false,
"__APP_VERSION__": false,

1
flow-defs/globals.js

@ -6,6 +6,7 @@ declare var __PROD__: boolean
declare var __ENV__: string
declare var __PRINT_MODE__: string
declare var __SENTRY_URL__: string
declare var __GIT_REVISION__: string
declare var __GLOBAL_STYLES__: string
declare var __APP_VERSION__: string
declare var __STORYBOOK_ENV__: string

1
scripts/release.sh

@ -20,6 +20,7 @@ fi
# TODO check if version is not already there
# TODO check if local git HEAD is EXACTLY our remote master HEAD
export GIT_REVISION=`git rev-parse HEAD`
export SENTRY_URL=https://db8f5b9b021048d4a401f045371701cb@sentry.io/274561
rm -rf ./node_modules/.cache
yarn

4
src/components/ExportLogsBtn.js

@ -30,7 +30,9 @@ class ExportLogsBtn extends Component<{
const reportJSON = JSON.stringify(report)
const path = remote.dialog.showSaveDialog({
title: 'Export logs',
defaultPath: `ledger_export_${moment().format('YYYY-MM-DD_HHmmss')}.json`,
defaultPath: `ledgerlive-export-${moment().format(
'YYYY.MM.DD-HH.mm.ss',
)}-${__GIT_REVISION__ || 'unversionned'}.json`,
filters: [
{
name: 'All Files',

1
src/sentry/install.js

@ -8,6 +8,7 @@ export default (Raven: any, shouldSendCallback: () => boolean, userId: string) =
captureUnhandledRejections: true,
allowSecretKey: true,
release: __APP_VERSION__,
tags: { git_commit: __GIT_REVISION__ },
environment: __DEV__ ? 'development' : 'production',
shouldSendCallback,
})

3
webpack/plugins.js

@ -3,7 +3,7 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const pkg = require('../package.json')
require('../src/globals')
const { BUNDLE_ANALYZER, SENTRY_URL, STORYBOOK_ENV } = process.env
const { BUNDLE_ANALYZER, SENTRY_URL, STORYBOOK_ENV, GIT_REVISION } = process.env
module.exports = type => {
const plugins = [
@ -12,6 +12,7 @@ module.exports = type => {
__GLOBAL_STYLES__: JSON.stringify(__GLOBAL_STYLES__),
__DEV__,
__PROD__,
__GIT_REVISION__: JSON.stringify(GIT_REVISION),
__SENTRY_URL__: JSON.stringify(SENTRY_URL || null),
__STORYBOOK_ENV__: JSON.stringify(STORYBOOK_ENV),
'process.env.NODE_ENV': JSON.stringify(__ENV__),

Loading…
Cancel
Save