Sign inSign up

peekleon/gitlab-var-mng

By peekleon

Updated over 3 years ago

Import, export or clean your CI/CD variables in your gitlab projects or groups on yml format

Image
1

475

peekleon/gitlab-var-mng repository overview

Gitlab variables manager

Import, export or clean your CI/CD variables in your gitlab projects or groups on yml format.

Sources: https://github.com/PeekLeon/gitlab-var-mng

Parameters

You can use a environment varaibles or parameters. Parameters override environment variables.

Options:

 --api-version=<value>       gitlab api version (default: 4)
 --group-id=<value>          gitlab group id [$GROUP_ID]
 --help                      show help (default: false)
 --push=<value>              push variables from file name [$PUSH]
 --pull=<value>              pull variables to file name [$PULL]
 --project-id=<value>        gitlab project id [$PROJECT_ID]
 --remove-all                Remove all variables
 --token=<value>             gitlab token [$TOKEN]
 --url=<value>               gitlab url (with http:// or https://) [$URL]

Volume

Path /data contain the exports.

If you use the --remove-all option, an export is automatically created in this path with the name export_var_<ID>.yml or with the --pull value.

How to use

docker run --env-file gitlab-prod.env -v /<your_volume>/:/data peekleon/gitlab-var-mng --help

push:

docker run --env-file gitlab-prod.env -v /<your_volume>/:/data peekleon/gitlab-var-mng --push=my_var.yml

pull:

docker run --env-file gitlab-prod.env -v /<your_volume>/:/data peekleon/gitlab-var-mng --pull=my_var.yml

push and pull:

docker run --env-file gitlab-prod.env -v /<your_volume>/:/data peekleon/gitlab-var-mng --pull=my_var.yml --push=my_other_var.yml

In the order : pull, remove-all and push.

Example of env file :

URL=https://gitlab.whatever.com
TOKEN=XXXXXXXXXXXXXXXXXX
PROJECT_ID=999
...

Import/export variables example :

- variable_type: env_var
  key: VAR_1
  value: value-01
  protected: false
  masked: false
  raw: false
  environment_scope: staging
- variable_type: env_var
  key: VAR_2
  value: value-02
  protected: false
  masked: false
  raw: false
  environment_scope: staging

Tag summary

Content type

Image

Digest

sha256:ced12f5c2

Size

16.9 MB

Last updated

over 3 years ago

docker pull peekleon/gitlab-var-mng