-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(worker): Add sentry to xapian worker scope
- Loading branch information
Showing
12 changed files
with
107 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,7 @@ mockserver.log | |
|
||
# CI artifacts | ||
cypress/videos | ||
|
||
# environment | ||
src/environments/env.ts | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env node | ||
|
||
const Debug = require('debug') | ||
const fs = require('fs'); | ||
|
||
const target = 'src/environments/env.ts' | ||
const debug = Debug('runbox:gen-env') | ||
|
||
debug(`Writing env file to ${target}.`) | ||
|
||
const env = [ | ||
['SENTRY_DSN', tryCatch(assertString, orNull)], | ||
] | ||
|
||
function assertString(input) { | ||
if (typeof input !== 'string') { | ||
throw new TypeError(`Expected a string, but received ${typeof input}`); | ||
} | ||
return input; | ||
} | ||
|
||
function tryCatch (tryFn, catchFn) { | ||
return value => { | ||
try { | ||
return tryFn(value); | ||
} catch (error) { | ||
return catchFn(error, value) | ||
} | ||
} | ||
} | ||
|
||
function orNull () { | ||
return null | ||
} | ||
|
||
|
||
fs.writeFileSync('src/environments/env.ts', `// This file is auto-generated. | ||
export default ${JSON.stringify( | ||
env.reduce((acc, [name, fn]) => { | ||
acc[name] = fn(process.env[name], name) | ||
return acc | ||
}, {}) | ||
, null, 2)}`); | ||
|
||
debug(`Wrote env file to ${target}.`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
// --------- BEGIN RUNBOX LICENSE --------- | ||
// Copyright (C) 2016-2018 Runbox Solutions AS (runbox.com). | ||
// | ||
// | ||
// This file is part of Runbox 7. | ||
// | ||
// | ||
// Runbox 7 is free software: You can redistribute it and/or modify it | ||
// under the terms of the GNU General Public License as published by the | ||
// Free Software Foundation, either version 3 of the License, or (at your | ||
// option) any later version. | ||
// | ||
// | ||
// Runbox 7 is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// General Public License for more details. | ||
// | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Runbox 7. If not, see <https://www.gnu.org/licenses/>. | ||
// ---------- END RUNBOX LICENSE ---------- | ||
|
||
import { environment as defaultEnvironment } from './environment'; | ||
|
||
export const environment = { | ||
production: true | ||
}; | ||
...defaultEnvironment, | ||
production: false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
// --------- BEGIN RUNBOX LICENSE --------- | ||
// Copyright (C) 2016-2018 Runbox Solutions AS (runbox.com). | ||
// | ||
// | ||
// This file is part of Runbox 7. | ||
// | ||
// | ||
// Runbox 7 is free software: You can redistribute it and/or modify it | ||
// under the terms of the GNU General Public License as published by the | ||
// Free Software Foundation, either version 3 of the License, or (at your | ||
// option) any later version. | ||
// | ||
// | ||
// Runbox 7 is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// General Public License for more details. | ||
// | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Runbox 7. If not, see <https://www.gnu.org/licenses/>. | ||
// ---------- END RUNBOX LICENSE ---------- | ||
|
||
// The file contents for the current environment will overwrite these during build. | ||
// The build system defaults to the dev environment which uses `environment.ts`, but if you do | ||
// `ng build --env=prod` then `environment.prod.ts` will be used instead. | ||
// The list of which env maps to which file can be found in `.angular-cli.json`. | ||
import env from './env' | ||
|
||
export const environment = { | ||
production: false | ||
...env, | ||
production: false, | ||
}; |