From 5c4ab29ccded8ad9b6605b00cf43400e8855d5ea Mon Sep 17 00:00:00 2001 From: Florent LE BOULCH Date: Mon, 13 May 2024 17:20:04 +0200 Subject: [PATCH] fix: Add an environment variable for gitlab url --- .env.test | 1 + README.md | 4 ++++ src/constants.ts | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.env.test b/.env.test index fd8b358..2cd8a7c 100644 --- a/.env.test +++ b/.env.test @@ -7,3 +7,4 @@ POSTGRES_PORT=54320 POSTGRES_USER=root SLACK_BOT_USER_O_AUTH_ACCESS_TOKEN=SLACK_BOT_USER_O_AUTH_ACCESS_TOKEN SLACK_SIGNING_SECRET=SLACK_SIGNING_SECRET +GITLAB_URL=https://git.manomano.tech diff --git a/README.md b/README.md index ee4b1d0..4f720a3 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,10 @@ Create a `.env` file containing the following variables: ![OAuth token](docs/assets/slack/oauth-token.png) +- `GITLAB_URL` + + The gitlab url of your organization + If you want Homer to connect to an **external PostgreSQL database**, you can set the following variables: diff --git a/src/constants.ts b/src/constants.ts index 4254e57..8d1f6e3 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,4 +1,5 @@ import type { GitlabMergeRequestState } from '@/core/typings/GitlabMergeRequest'; +import { getEnvVariable } from '@/core/utils/getEnvVariable'; export const CHANNEL_NOT_FOUND_SLACK_ERROR = 'channel_not_found'; export const EXPIRED_TRIGGER_ID_ERROR_MESSAGE = @@ -6,7 +7,7 @@ export const EXPIRED_TRIGGER_ID_ERROR_MESSAGE = export const EXPIRED_TRIGGER_ID_SLACK_ERROR = 'expired_trigger_id'; export const GENERIC_ERROR_MESSAGE = "D'oh! Something went wrong :homer-stressed: You will probably find more information on the error on ."; -export const GITLAB_URL = 'https://git.manomano.tech'; +export const GITLAB_URL = getEnvVariable('GITLAB_URL'); export const HOMER_GITLAB_URL = `${GITLAB_URL}/tools/homer`; export const HTTP_STATUS_NO_CONTENT = 204; export const HTTP_STATUS_OK = 200;