Crates.io | gl-env |
lib.rs | gl-env |
version | 0.1.0 |
source | src |
created_at | 2024-09-26 20:03:13.192695 |
updated_at | 2024-09-26 20:03:13.192695 |
description | Bulk-edit Group- and Project-level CI/CD variables in GitLab. |
homepage | |
repository | https://github.com/mhutter/gl-env |
max_upload_size | |
id | 1387964 |
size | 44,050 |
gl-env
Bulk-edit Group- and Project-level CI/CD variables in GitLab.
This tools allows you to define your desired variables in a YAML file, and then diff or apply them automatically.
Features
Start off by dumping existing variables into a YAML-File
gl-env dump -p mygroup/myproject > myproject.yml
Alternatively, create a file from scratch:
# Default configuration to apply to all variables.
#
# The same attributes can be applied to individual variables.
defaults:
# Whether to mask the value in job logs.
# NOTE: masked variable values must
# - be a single line with no spaces
# - be at least 8 characters long
# - not match the name of an existing or predefined CI/CD variable
# - not include special characters other than `@`, `_`, `-`, `:`, `+`
# Default: `false`
masked: false
# Export variable to pipelines running on protected branches and tags only.
# Default: `false`
protected: false
# Don't expand references to other variables.
# `$` will be treated as the start of a reference to another variable.
# Default: `false`
raw: false
# Variables valid for ALL environments (`*`)
variables:
KEY:
value: The value!
raw: true
ANOTHER:
value: some-val
# Variables only valid for specific environments
environment:
test:
MYSERVICE_KEY:
value: test-environment-api-key
prod:
MYSERVICE_KEY:
value: production-environment-api-key
You can then use the diff
and apply
subcommands:
gl-env diff -p mygroup/myproject < myproject.yml
# edit myproject.yml
gl-env apply -p mygroup/myproject < myproject.yml
See gl-env help
to get complete usage information.
Licensed under the MIT license.