Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nginxinc/git-automation
This is reference automation for pushing configurations from Git to Nginx Instance Manager, that allows a user to manage configurations for instances and instance groups keeping Git as the source of truth.
https://github.com/nginxinc/git-automation
Last synced: 9 days ago
JSON representation
This is reference automation for pushing configurations from Git to Nginx Instance Manager, that allows a user to manage configurations for instances and instance groups keeping Git as the source of truth.
- Host: GitHub
- URL: https://github.com/nginxinc/git-automation
- Owner: nginxinc
- License: apache-2.0
- Created: 2023-10-10T20:22:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-13T23:39:04.000Z (about 1 year ago)
- Last Synced: 2024-11-06T10:19:40.348Z (about 2 months ago)
- Language: Shell
- Size: 34.2 KB
- Stars: 2
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# git_automation
This is a reference automation for pushing configurations from Git to Nginx Instance Manager, that allows a user to manage configurations for instances and instance groups keeping Git as the source of truth.
## Requirements
- bash shell
- Installed Nginx Instance Manager with atleast one Instance and Instance Group.## How to Use
1. To clone this repository,
```
git clone https://github.com/nginxinc/git-automation.git
```2. Once you have cloned the repository, modify the following variables in `gitlab-ci.yaml` file:
```
CTRL_IP - IP for Nginx Instance Manager.
AUTH_TOKEN - Authorization token for connecting to Nginx Instance Manager.
SYSTEM_UID - System UID of the instance to push configuration changes.
NGINX_UID - Nginx UID of the instance to push configuration changes.
GROUP_UID - Instance Group UID of the instance group to push configurations changes.
3. This repository has sample script files to create payload for instances [prepare-payload.sh](https://github.com/nginxinc/git-automation/blob/main/prepare-payload.sh "prepare-payload.sh") and instance groups [prepare-instGroup-payload.sh](https://github.com/nginxinc/git-automation/blob/main/prepare-instGroup-payload.sh "prepare-instGroup-payload.sh")Usage example for [prepare-payload.sh](https://github.com/nginxinc/git-automation/blob/main/prepare-payload.sh "prepare-payload.sh") :
```
./prepare-payload.sh ${CTRL_IP} ${AUTH_TOKEN} ${SYSTEM_UID} ${NGINX_UID}
```Usage example for [prepare-instGroup-payload.sh](https://github.com/nginxinc/git-automation/blob/main/prepare-instGroup-payload.sh "prepare-instGroup-payload.sh") :
```
./prepare-instGroup-payload.sh ${CTRL_IP} ${AUTH_TOKEN} ${GROUP_UID}
```
4. Once you commit, push your changes upstream a separate pipeline should be triggered for instance or instances groups depending if changes are made in the config files for it. You can specify the default path for config files using environment variables.
```
DEFAULT_INSTANCE_CONFIG_FILE_PATH : Config file location for Instances.
DEFAULT_INSTANCE_GROUP_CONFIG_FILE_PATH: Config file location Instance Groups.
```5. Once the pipeline is triggered, it will create a valid payload with `externalId` set as the git commit ID and send a `POST` request to Nginx Instance Manager to apply the new configuration changes.
## Contributing
Please see the [contributing guide](https://github.com/nginxinc/git-automation/blob/main/CONTRIBUTING.md) for guidelines on how to best contribute to this project.
## License
[Apache License, Version 2.0](https://github.com/nginxinc/git-automation/blob/main/LICENSE)
© [F5, Inc.](https://www.f5.com/) 2023