-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1448 from cloud-pi-native/hotfix/gitlab-plugin-2
Hotfix/gitlab plugin 2
- Loading branch information
Showing
9 changed files
with
124 additions
and
116 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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { removeTrailingSlash, requiredEnv } from '@cpn-console/shared' | ||
|
||
class Config { | ||
publicUrl: string | ||
internalUrl: string | ||
token: string | ||
projectsRootDir: string | ||
constructor() { | ||
this.token = requiredEnv('GITLAB_TOKEN') | ||
this.publicUrl = removeTrailingSlash(requiredEnv('GITLAB_URL')) | ||
this.projectsRootDir = requiredEnv('PROJECTS_ROOT_DIR') | ||
this.internalUrl = process.env.GITLAB_INTERNAL_URL | ||
? removeTrailingSlash(process.env.GITLAB_INTERNAL_URL) | ||
: this.publicUrl | ||
} | ||
} | ||
|
||
let config: Config | undefined | ||
|
||
function getConfig() { | ||
if (!config) { | ||
config = new Config() | ||
} | ||
return config | ||
} | ||
export default getConfig |
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 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