Gitlab env
Install
npm install @uig/gitlab-env --save-dev
or
yarn add -D @uig/gitlab-env
Usage
Save gitlab Personal Access Token to ~/.glconfig
to use it in all projects.
- Create PATH - https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
- Needed scope:
api
,read_api
,read_repository
- Needed scope:
- Save token gitlab api url in
~/.glconfig
file
{
"token" : "<TOKEN>",
"url" : "<GITLAB_INSTANCE_URL>"
}
- Edit
package.json > postinstall
script:
{
"scripts": {
"postinstall": "gitlab-env -i <ID>"
}
}
- Run it once
yarn postinstall
Available 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 |