Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
yakatz committed Feb 15, 2024
1 parent 1aeddb2 commit cbf0469
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
17 changes: 9 additions & 8 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1186,28 +1186,29 @@ Default value: `$gitlab::skip_post_deployment_migrations`
### <a name="gitlab--custom_hook"></a>`gitlab::custom_hook`

Custom hooks can be created as a pre-receive, post-receive, or update hook.
It is possible to create different custom hook types for the same project - one each for pre-receive, post-receive and update.
Only one of each is currently supported by this module.

#### Examples

##### Custom hook usage

```puppet
gitlab::custom_hook { 'my_custom_hook':
namespace => 'my_group',
project => 'my_project',
type => 'post-receive',
source => 'puppet:///modules/my_module/post-receive',
namespace => 'my_group',
project => 'my_project',
type => 'post-receive',
source => 'puppet:///modules/my_module/post-receive',
}
```

##### Calculate hashed storage path

```puppet
gitlab::custom_hook { 'my_custom_hook':
project => 93,
type => 'post-receive',
source => 'puppet:///modules/my_module/post-receive',
project => 93,
hashed_storage => true,
type => 'post-receive',
source => 'puppet:///modules/my_module/post-receive',
}
# Hook path will be `@hashed/6e/40/6e4001871c0cf27c7634ef1dc478408f642410fd3a444e2a88e301f5c4a35a4d`
```
Expand Down
17 changes: 9 additions & 8 deletions manifests/custom_hook.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
# Manage custom hook files within a GitLab project.
#
# Custom hooks can be created as a pre-receive, post-receive, or update hook.
# It is possible to create different custom hook types for the same project - one each for pre-receive, post-receive and update.
# Only one of each is currently supported by this module.
#
# @example Custom hook usage
# gitlab::custom_hook { 'my_custom_hook':
# namespace => 'my_group',
# project => 'my_project',
# type => 'post-receive',
# source => 'puppet:///modules/my_module/post-receive',
# namespace => 'my_group',
# project => 'my_project',
# type => 'post-receive',
# source => 'puppet:///modules/my_module/post-receive',
# }
#
# @example Calculate hashed storage path
# gitlab::custom_hook { 'my_custom_hook':
# project => 93,
# type => 'post-receive',
# source => 'puppet:///modules/my_module/post-receive',
# project => 93,
# hashed_storage => true,
# type => 'post-receive',
# source => 'puppet:///modules/my_module/post-receive',
# }
# # Hook path will be `@hashed/6e/40/6e4001871c0cf27c7634ef1dc478408f642410fd3a444e2a88e301f5c4a35a4d`
#
Expand Down

0 comments on commit cbf0469

Please sign in to comment.