The GitOps Model
The GitOps model is dependent on
- Git Events
- Webhooks
- Listeners
- Actions
#
Git EventsAn event is something that happens in a Git repo. Whenever there are changes occurring in the Git repository - Git generates events. This event triggers an already configured webhook URL.
For instance,
- Tag events are triggered when you create or delete tags in the repository.
- Similarly, creating a pull request is an event in Git where a contributor asks a maintainer of a Git repository to review code they want to merge into a project.
Refer to the doc to know more about GitHub event types.
#
WebhooksWebhooks are custom HTTP callbacks that you define. They are usually triggered by an event, such as pushing code to a repository. When the event occurs, the source app makes an HTTP request to the URL configured for the webhook.
Read more about webhooks here in this doc!
#
ListenersListeners are used to observe events occurring within the Git repo and then perform the specified actions. When an event triggers a webhook request, a message to the specified URL is sent. At the URL endpoint, a webhook listener receives the message and then executes actions according to the message's content.
#
ActionsActions are the tasks which a listener will trigger on receiving an event.
For instance, in the BuildPiper system one can configure the following actions
- Trigger a build for an environment of a service.
- Trigger a Deployment for an environment of a service.
- Trigger a Pipeline (for performing CI or CD or any task set).