-
Notifications
You must be signed in to change notification settings - Fork 0
3x ConsoleCommands
GitHooks is based on Laravel Zero Framework which is a micro-framework for console applications. So the way to launch commands in GitHooks is like Laravel's Artisan commands. You can run githooks list to see all available commands.
Creates the configuration file in the root of the project path. You can move to the qa directory. GitHooks will search these two paths for the file githooks.yml.
Check if githooks.yml is in root or qa path. Also check the file format. As the tools can have many options, although the command indicates that the format is correct, there may be errors. Despite this, it can help you correct some errors.
Also, shows a summary of setted jobs and flows:
Enable the execution of GitHooks in the hooks setted.
githooks hook pre-commit # Enable pre-commit hook
githooks hook # Enable all hooks settedIt is highly recommended to run this command after the composer install and composer update events of the application. In this way you make sure that everyone has the hooks configured at all times. To do this you must add the following lines in the scripts section of composer.json:
"scripts": {
"post-update-cmd": [
"vendor/bin/githooks hook"
],
"post-install-cmd": [
"vendor/bin/githooks hook"
]
}Deletes the hook passed as argument (default all).
You can run any flow setted in GitHooks.
githooks flow $flow [--exclude-jobs] [--execution] [--processes] [--fail-fast] [--ignoreErrorsOnExit]- exclude-jobs: A list of jobs to exclude from the flow execution.
- the rest of the arguments are described in the keyword reference section.
If you want to run a single job look at the Job command.
Allows you to run jobs in isolation. Shows on the screen the command that is launched under the hood. Certain parameters can be overridden by cli, which facilitates the trial/error of a job during its development
githooks job $job [execution] [--executablePath] [--paths] [--otherArguments] [--ignoreErrorsOnExit]
