Skip to content

Commit 6059809

Browse files
committed
Fix documentation
1 parent 48662b6 commit 6059809

File tree

3 files changed

+30
-49
lines changed

3 files changed

+30
-49
lines changed

REFERENCE.md

+16-22
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
### Defined types
1818

19-
* [`gitlab::custom_hook`](#gitlab--custom_hook): Manage custom hook files within a GitLab project.
20-
* [`gitlab::global_hook`](#gitlab--global_hook): Manage global chain loaded hook files for all GitLab projects.
19+
* [`gitlab::custom_hook`](#gitlab--custom_hook): Manage custom hook files within a GitLab project. Custom hooks can be created as a pre-receive, post-receive, or update hook. Only one of each is currently supported by this module.
20+
* [`gitlab::global_hook`](#gitlab--global_hook): Manage global chain loaded hook files for all GitLab projects. Hooks can be created as a pre-receive, post-receive, or update hook. It's possible to create multipe hooks per type as long as their names are unique. Support for chained (global) hooks is introduced in GitLab Shell 4.1.0 and GitLab 8.15.
2121
* [`gitlab::system_hook`](#gitlab--system_hook): A file hook will run on each event so it's up to you to filter events or projects
2222

2323
### Tasks
@@ -1185,29 +1185,29 @@ Default value: `$gitlab::skip_post_deployment_migrations`
11851185

11861186
### <a name="gitlab--custom_hook"></a>`gitlab::custom_hook`
11871187

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

11911190
#### Examples
11921191

11931192
##### Custom hook usage
11941193

11951194
```puppet
11961195
gitlab::custom_hook { 'my_custom_hook':
1197-
namespace => 'my_group',
1198-
project => 'my_project',
1199-
type => 'post-receive',
1200-
source => 'puppet:///modules/my_module/post-receive',
1196+
namespace => 'my_group',
1197+
project => 'my_project',
1198+
type => 'post-receive',
1199+
source => 'puppet:///modules/my_module/post-receive',
12011200
}
12021201
```
12031202

12041203
##### Calculate hashed storage path
12051204

12061205
```puppet
12071206
gitlab::custom_hook { 'my_custom_hook':
1208-
project => 93,
1209-
type => 'post-receive',
1210-
source => 'puppet:///modules/my_module/post-receive',
1207+
project => 93,
1208+
hashed_storage => true,
1209+
type => 'post-receive',
1210+
source => 'puppet:///modules/my_module/post-receive',
12111211
}
12121212
# Hook path will be `@hashed/6e/40/6e4001871c0cf27c7634ef1dc478408f642410fd3a444e2a88e301f5c4a35a4d`
12131213
```
@@ -1248,17 +1248,15 @@ The custom hook type. Should be one of pre-receive, post-receive, or update.
12481248

12491249
Data type: `Optional[String]`
12501250

1251-
Specify the custom hook contents either as a string or using the template function. If this paramter is specified source
1252-
parameter must not be present.
1251+
Specify the custom hook contents either as a string or using the template function. If this paramter is specified source parameter must not be present.
12531252

12541253
Default value: `undef`
12551254

12561255
##### <a name="-gitlab--custom_hook--source"></a>`source`
12571256

12581257
Data type: `Optional[String]`
12591258

1260-
Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not
1261-
be present.
1259+
Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not be present.
12621260

12631261
Default value: `undef`
12641262

@@ -1280,9 +1278,7 @@ Default value: `false`
12801278

12811279
### <a name="gitlab--global_hook"></a>`gitlab::global_hook`
12821280

1283-
Hooks can be created as a pre-receive, post-receive, or update hook.
1284-
It's possible to create multipe hooks per type as long as their names are unique.
1285-
Support for chained (global) hooks is introduced in GitLab Shell 4.1.0 and GitLab 8.15.
1281+
Manage global chain loaded hook files for all GitLab projects. Hooks can be created as a pre-receive, post-receive, or update hook. It's possible to create multipe hooks per type as long as their names are unique. Support for chained (global) hooks is introduced in GitLab Shell 4.1.0 and GitLab 8.15.
12861282

12871283
#### Examples
12881284

@@ -1322,17 +1318,15 @@ Default value: `$gitlab::custom_hooks_dir`
13221318

13231319
Data type: `Optional[String[1]]`
13241320

1325-
Specify the custom hook contents either as a string or using the template function. If this paramter is specified source
1326-
parameter must not be present.
1321+
Specify the custom hook contents either as a string or using the template function. If this paramter is specified source parameter must not be present.
13271322

13281323
Default value: `undef`
13291324

13301325
##### <a name="-gitlab--global_hook--source"></a>`source`
13311326

13321327
Data type: `Optional[Pattern[/^puppet:/]]`
13331328

1334-
Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not
1335-
be present.
1329+
Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not be present.
13361330

13371331
Default value: `undef`
13381332

manifests/custom_hook.pp

+11-16
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
1-
# @summary
2-
# Manage custom hook files within a GitLab project.
3-
#
4-
# Custom hooks can be created as a pre-receive, post-receive, or update hook.
5-
# It is possible to create different custom hook types for the same project - one each for pre-receive, post-receive and update.
1+
# @summary Manage custom hook files within a GitLab project. Custom hooks can be created as a pre-receive, post-receive, or update hook. Only one of each is currently supported by this module.
62
#
73
# @example Custom hook usage
84
# gitlab::custom_hook { 'my_custom_hook':
9-
# namespace => 'my_group',
10-
# project => 'my_project',
11-
# type => 'post-receive',
12-
# source => 'puppet:///modules/my_module/post-receive',
5+
# namespace => 'my_group',
6+
# project => 'my_project',
7+
# type => 'post-receive',
8+
# source => 'puppet:///modules/my_module/post-receive',
139
# }
1410
#
1511
# @example Calculate hashed storage path
1612
# gitlab::custom_hook { 'my_custom_hook':
17-
# project => 93,
18-
# type => 'post-receive',
19-
# source => 'puppet:///modules/my_module/post-receive',
13+
# project => 93,
14+
# hashed_storage => true,
15+
# type => 'post-receive',
16+
# source => 'puppet:///modules/my_module/post-receive',
2017
# }
2118
# # Hook path will be `@hashed/6e/40/6e4001871c0cf27c7634ef1dc478408f642410fd3a444e2a88e301f5c4a35a4d`
2219
#
2320
# @param project The GitLab project name, or the hashed directory name or project ID number
2421
# @param namespace The GitLab group namespace for the project.
2522
# @param type The custom hook type. Should be one of pre-receive, post-receive, or update.
26-
# @param content Specify the custom hook contents either as a string or using the template function. If this paramter is specified source
27-
# parameter must not be present.
28-
# @param source Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not
29-
# be present.
23+
# @param content Specify the custom hook contents either as a string or using the template function. If this paramter is specified source parameter must not be present.
24+
# @param source Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not be present.
3025
# @param repos_path The GitLab shell repos path. This defaults to '/var/opt/gitlab/git-data/repositories' if not present.
3126
# @param hashed_storage Whether to treat the project name as a hashed storage directory name or ID number
3227
#

manifests/global_hook.pp

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
# @summary
2-
# Manage global chain loaded hook files for all GitLab projects.
3-
#
4-
# Hooks can be created as a pre-receive, post-receive, or update hook.
5-
# It's possible to create multipe hooks per type as long as their names are unique.
6-
# Support for chained (global) hooks is introduced in GitLab Shell 4.1.0 and GitLab 8.15.
1+
# @summary Manage global chain loaded hook files for all GitLab projects. Hooks can be created as a pre-receive, post-receive, or update hook. It's possible to create multipe hooks per type as long as their names are unique. Support for chained (global) hooks is introduced in GitLab Shell 4.1.0 and GitLab 8.15.
72
#
83
# @example Global hook usage
94
# gitlab::custom_hook { 'my_custom_hook':
@@ -13,11 +8,8 @@
138
#
149
# @param type The custom hook type. Should be one of pre-receive, post-receive, or update.
1510
# @param custom_hooks_dir The GitLab shell repos path. This defaults to '/opt/gitlab/embedded/service/gitlab-shell/hooks' if not present.
16-
# @param content Specify the custom hook contents either as a string or using the template function. If this paramter is specified source
17-
# parameter must not be present.
18-
# @param source Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not
19-
# be present.
20-
#
11+
# @param content Specify the custom hook contents either as a string or using the template function. If this paramter is specified source parameter must not be present.
12+
# @param source Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not be present.
2113
define gitlab::global_hook (
2214
Enum['post-receive', 'pre-receive', 'update'] $type,
2315
Stdlib::Absolutepath $custom_hooks_dir = $gitlab::custom_hooks_dir,

0 commit comments

Comments
 (0)