0.5.3 • Published 3 years ago
@uigstudio/gitlab-env v0.5.3
Gitlab env
Install
npm install @uig/gitlab-env --save-devor
yarn add -D @uig/gitlab-envUsage
Save gitlab Personal Access Token to ~/.glconfig to use it in all projects.
1. Create PATH - https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
- Needed scope: api, read_api, read_repository
2. Save token gitlab api url in ~/.glconfig file
{
"token" : "<TOKEN>",
"url" : "<GITLAB_INSTANCE_URL>"
}- Edit
package.json > postinstallscript:
{
"scripts": {
"postinstall": "gitlab-env -i <ID>"
}
}- Run it once
yarn postinstallAvailable props
| Name | Type | Default | Description |
|---|---|---|---|
-i, --id | string or number | REQUIRED | Gitlab project id |
-e, --env | string | local | Enviroment |
-o, --output | string | .env.local | Outout file |
-c, --glConfig | string | ~/.glconfig | File with gitlab auth token |
-t, --token | string | undefined | Gitlab auth token |
-b, --blocklist | string | undefined | Coma separated blocked keys |
-m, --mode | enum(replace, append) | replace | Save mode |
-u, --url | string | https://gitlab.com | Gitlab instance url |