https://github.com/eitrtechnologies/githook-saltapply
https://github.com/eitrtechnologies/githook-saltapply
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/eitrtechnologies/githook-saltapply
- Owner: eitrtechnologies
- License: apache-2.0
- Created: 2021-08-04T21:55:58.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-04T22:00:02.000Z (almost 5 years ago)
- Last Synced: 2025-02-17T08:12:56.540Z (over 1 year ago)
- Language: Python
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Run Salt States via Git Webhook
Process incoming git webhooks and run a specified Salt state.
Environment variable configuration:
* `GITHOOK_SECRET` - Secret for validation of GitHub or GitLab payloads.
* `LOG_LEVEL` - (optional) Log level for app messages. Defaults to INFO.
* `SALT_STATE` - State name to run using the Caller client (salt-call).
A `git_ref` key is passed in Pillar to the state in "refs/(heads|tags)/(name)" format.
Example State:
```
{%- set ref = pillar.get("git_ref", "").split("/") | last %}
sync_git_{{ref}}_env:
git.latest:
- name: https://github.com/eitrtechnologies/idem-azurerm.git
- target: /srv/salt/{{ ref }}
- rev: {{ ref }}
- branch: {{ ref }}
```