refactor: add sentry to staging env and fix debug

This commit is contained in:
Alexis Tyler
2020-09-26 16:12:46 +09:30
parent 27d749a340
commit 68131b96ad
3 changed files with 19 additions and 14 deletions

View File

@@ -97,7 +97,7 @@ export const connectToMothership = async (wsServer: WebSocket.Server, currentRet
});
relay.on('open', async () => {
log.debug(`Connected to mothership's relay.`);
log.debug(`Connected to mothership's relay via ${MOTHERSHIP_RELAY_WS_LINK}.`);
// Reset retry attempts
retryAttempt = 0;

View File

@@ -54,9 +54,6 @@ fi
downloads=(graphql-api plugins)
env="production"
base_directory="/usr/local/bin/node"
if [[ $* == *--mode\=dev* ]]; then
env="development"
fi
status() {
local graphql_api_pid=$(pidof graphql-api | awk '{print $1}')
if [[ $graphql_api_pid ]]; then
@@ -87,7 +84,7 @@ startdebug() {
stop
local old_working_directory=$(echo $pwd)
cd $base_directory
pm2 start $base_directory/graphql-api/ecosystem.config.js --env=debug --no-daemon
pm2 start $base_directory/graphql-api/ecosystem.config.js --env=$(echo $env)-debug --no-daemon
cd $old_working_directory
}
stop() {

View File

@@ -1,6 +1,15 @@
/* eslint-disable camelcase */
const path = require('path');
const staging = {
MOTHERSHIP_RELAY_WS_LINK: 'wss://staging.mothership.unraid.net/relay',
SENTRY_DSN: 'https://335a7a44d1a048648a585fc4fa053d65@o427961.ingest.sentry.io/5439629'
};
const production = {
NODE_ENV: 'production',
PORT: '/var/run/graphql-api.sock'
}
const envs = {
env_development: {
PORT: 5000,
@@ -14,16 +23,15 @@ const envs = {
'env_safe-mode': {
NODE_ENV: 'safe-mode'
},
env_debug: {
env_staging: staging,
'env_staging-debug': {
...staging,
DEBUG: true,
},
env_production: production,
'env_production-debug': {
...production,
DEBUG: true
},
env_staging: {
MOTHERSHIP_RELAY_WS_LINK: 'wss://staging.mothership.unraid.net/relay',
SENTRY_DSN: 'https://335a7a44d1a048648a585fc4fa053d65@o427961.ingest.sentry.io/5439629'
},
env_production: {
NODE_ENV: 'production',
PORT: '/var/run/graphql-api.sock'
}
};