Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mhutter/gl-env
Bulk-edit Group- and Project-level CI/CD variables in GitLab.
https://github.com/mhutter/gl-env
Last synced: 25 days ago
JSON representation
Bulk-edit Group- and Project-level CI/CD variables in GitLab.
- Host: GitHub
- URL: https://github.com/mhutter/gl-env
- Owner: mhutter
- License: mit
- Created: 2024-09-26T20:00:43.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-11T10:45:15.000Z (about 1 month ago)
- Last Synced: 2024-11-27T07:12:40.401Z (29 days ago)
- Language: Rust
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `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
- List variables
- Dump existing variables to YAML
- Diff between desired and current values
- Apply variables from local file
- Support for different environment scopes## Installation
```sh
cargo install gl-env
```(OS packages & GitHub releases soon?)
## Usage
Start off by dumping existing variables into a YAML-File
```sh
gl-env dump -p mygroup/myproject > myproject.yml
```Alternatively, create a file from scratch:
```yaml
# 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:
```sh
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.
## Backlog
- [x] Support group-level variables or instance-level variables
- [ ] Non-ugly error messages
- [ ] String-or-struct for variables (?)
- [x] Remove obsolete variables
- [x] Default settings for all variables
- [x] diff
- [x] apply
- [x] Support identically-named variables in different environments
- [x] Ensure output order of variables is stable
- [x] apply: List variables that are defined in GitLab but not locally## License
Licensed under the [MIT license](LICENSE).