Commit c379c95 1 parent b82a59a commit c379c95 Copy full SHA for c379c95
File tree 5 files changed +21
-7
lines changed
5 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,17 @@ DISCORD_WEBHOOK_TOKEN=
3
3
DISCORD_WEBHOOK_USERNAME =
4
4
DISCORD_WEBHOOK_IMAGE_URL =
5
5
6
- AXIOS_TIMEOUT = 1000
6
+ AXIOS_TIMEOUT =
7
7
8
8
DEPLOY_PLATFORM_URL =
9
9
DEPLOY_PLATFORM_TOKEN =
10
+ DEPLOY_PLATFORM_TEAM_ID =
10
11
11
12
PRODUCTION_URL =
12
13
13
14
ENVIRONMENT_RELEASE_NAME =
14
15
ENVIRONMENT_NAME =
15
- DEPLOY_NAME =
16
+
17
+ DEPLOY_NAME =
18
+
19
+ HOST_PRODUCTION_URL =
Original file line number Diff line number Diff line change 1
1
import axiosProvider from 'axios' ;
2
+ import dotenv from 'dotenv' ;
3
+
4
+ dotenv . config ( ) ;
2
5
3
6
export const axios = axiosProvider . create ( {
4
- timeout : Number ( process . env . AXIOS_TIMEOUT ) || 1000 ,
7
+ timeout : Number ( process . env . AXIOS_TIMEOUT ) || 5000 ,
5
8
baseURL : process . env . DEPLOY_PLATFORM_URL || '' ,
6
9
headers : {
7
10
Authorization : `Bearer ${ process . env . DEPLOY_PLATFORM_TOKEN } ` ,
8
11
} ,
12
+ params : {
13
+ target : 'preview' ,
14
+ teamId : process . env . DEPLOY_PLATFORM_TEAM_ID || '' ,
15
+ } ,
9
16
} ) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ export function globalExceptionHandler(
17
17
const messageEmbed = new DiscordMessageEmbed ( ) ;
18
18
const embed = messageEmbed
19
19
. setTitle ( 'An error ocurred' )
20
- . setDescription ( 'Search in logs for more description' )
20
+ . setDescription (
21
+ `See logs for further information\n${ process . env . HOST_PRODUCTION_URL } /logs/error.log` ,
22
+ )
21
23
. setColor ( STATUS_FAILED ) ;
22
24
23
25
const webhookClient = new DiscordWebhookClient ( ) ;
Original file line number Diff line number Diff line change 1
1
import 'reflect-metadata' ;
2
2
import 'express-async-errors' ;
3
- import dotenv from 'dotenv' ;
4
3
4
+ import dotenv from 'dotenv' ;
5
5
import express from 'express' ;
6
+
6
7
import { logger , logsPath } from './config/logger' ;
7
8
8
9
import { router } from './routes' ;
Original file line number Diff line number Diff line change @@ -65,13 +65,13 @@ export class SendReleaseDeploymentStatusService {
65
65
66
66
private async getURL ( { name } : Environment ) : Promise < string > {
67
67
if ( name . toLowerCase ( ) === process . env . ENVIRONMENT_NAME ?. toLowerCase ( ) ) {
68
- const axiosURL = `${ process . env . DEPLOY_PLATFORM_URL } ?target=preview ` ;
68
+ const axiosURL = `${ process . env . DEPLOY_PLATFORM_URL } ` ;
69
69
70
70
const {
71
71
data : { deployments } ,
72
72
} = await axios . get ( axiosURL ) ;
73
73
74
- if ( ! deployments )
74
+ if ( ! deployments || deployments . length <= 0 )
75
75
throw new Error ( 'Vercel API does not returned any value' ) ;
76
76
77
77
const { url } : IDeployPayload = deployments . find (
You can’t perform that action at this time.
0 commit comments