Skip to content

Setup Config Repo Pre receive Hook

Marcello de Sales edited this page Aug 13, 2018 · 5 revisions

Contents

  1. Github Pre-receive Hooks
  2. Enable Pre-receive Hook
  3. Disable Pre-receive Hook

Github Pre-receive Hooks

Information

The Spring Cloud Config Validator project exposes its script as a Pre-receive hook in Github Enterprise, which is fully compatible with the Github Host. The Validator script will validate configuration changes in the following scenarios:

Scenario Expected Behavior
Validate Localgit push When the user executes git push origin REPO and the origin is a valid Github Enterprise URL.
Validate Online commits When updating any Config Server configuration file through the Github Enterprise UI.
Validate Pull Requests When pressing the button Merge Pull Request when accepting a Pull Request.

Enabling or disabling the hook is enabled.

Enable Pre-receive Hook

Note You can enable the pre-receive hook any time in your repository. That won't cause any repo access disruption.

Go to Settings -> Hooks and services -> Pre-receive hooks section and enable the Spring Cloud Config Validator. Then, make sure it is Enabled instead of Disabled as shown below. You will see a green bullet prefixing the name.

Disable Pre-receive Hook

Note You can disable the pre-receive hook at any moment and it won't cause any repository disruption.

Opposite to the previous section, you must make sure it is Disabled as shown in the other hooks in the previous example. You will see a gray bullet prefixing the name.