Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AyogoHealth/gh-provision-envs
GitHub CLI command to provision environments with secrets and variables from a configuration file.
https://github.com/AyogoHealth/gh-provision-envs
Last synced: 3 months ago
JSON representation
GitHub CLI command to provision environments with secrets and variables from a configuration file.
- Host: GitHub
- URL: https://github.com/AyogoHealth/gh-provision-envs
- Owner: AyogoHealth
- License: mit
- Created: 2023-04-07T00:17:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-19T19:36:17.000Z (11 months ago)
- Last Synced: 2023-12-20T14:55:02.479Z (11 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# GitHub Environment Provisioning
A GitHub CLI command to provision environments with secrets and variables from a configuration file.
## Requirements
* The [GitHub CLI](https://cli.github.com/) tool
* Administrative permissions on the GitHub repositories you want to run this on
* NodeJS 18.x or newer## Usage
You can install this as an extension to the `gh` CLI tool. At its simplest, you give it a JSON config file and a repository name:
```
gh extension install AyogoHealth/gh-provision-envs
gh provision-envs -c config.json -R myuser/myrepo
```### Disclaimers
* This will **overwrite** variable and secret values if they already exist!
* This is a bit of a hack, cobbled together by spawning other `gh` commands
* If your secret/variable values contain double quotes, you'll maybe have a bad time...
* If you try to break it, you almost definitely will## Config File Format
The config file must be a valid JSON file, consisting of an object with an `environments` key that contains the environments you would like to provision.
### Example
```json
{
"environments": {
"staging": {
"variables": [
{
"name": "HOSTNAME",
"value": "staging.example.com"
}
],
"secrets": [
{
"name": "DEPLOY_KEY_PASSWORD",
"value": "MySecretPassword1"
}
]
},
"production": {
"variables": [
{
"name": "HOSTNAME",
"value": "example.com"
}
],
"secrets": [
{
"name": "DEPLOY_KEY_PASSWORD",
"value": "MySecretPassword2"
},
{
"name": "SECRET_PRODUCTION_VALUE",
"value": "ThisIsASecret"
}
]
}
}
}
```## Contributing
Contributions of bug reports, feature requests, and pull requests are greatly
appreciated!Please note that this project is released with a [Contributor Code of
Conduct](https://github.com/AyogoHealth/gh-provision-envs/blob/main/CODE_OF_CONDUCT.md).
By participating in this project you agree to abide by its terms.## Licence
Released under the [MIT Licence](LICENCE).
Copyright © 2023 Ayogo Health Inc.