Import, export or clean your CI/CD variables in your gitlab projects or groups on yml format
475
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
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]
Path /data contain the exports.
If you use the
--remove-alloption, an export is automatically created in this path with the nameexport_var_<ID>.ymlor with the--pullvalue.
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
Content type
Image
Digest
sha256:ced12f5c2…
Size
16.9 MB
Last updated
over 3 years ago
docker pull peekleon/gitlab-var-mng