Skip to content

Commit a535441

Browse files
richardcstack72
authored andcommitted
provider/gitlab: Documentation improvements (#14824)
* provider/gitlab: Fix documentation copypasta The original provider and docs were copied from the github provider, one bit of copy paste slipped unmissed. * provider/gitlab: Document `gitlab_project#id` * provider/gitlab: Document `gitlab_project#namespace_id` * provider/gitlab: Add fuller demonstration to the provider page Following in the style of other provider pages, add a worked example showing off all of the available resources offered by the gitlab provider. * provider/gitlab: Correct sample for gitlab_project
1 parent 8720320 commit a535441

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

index.html.markdown

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,35 @@ provider "gitlab" {
2323
token = "${var.gitlab_token}"
2424
}
2525
26-
# Add a project to the organization
26+
# Add a project owned by the user
2727
resource "gitlab_project" "sample_project" {
28-
...
28+
name = "example"
29+
}
30+
31+
# Add a hook to the project
32+
resource "gitlab_project_hook" "sample_project_hook" {
33+
project = "${gitlab_project.sample_project.id}"
34+
url = "https://example.com/project_hook"
35+
}
36+
37+
# Add a deploy key to the project
38+
resource "gitlab_deploy_key" "sample_deploy_key" {
39+
project = "${gitlab_project.sample_project.id}"
40+
title = "terraform example"
41+
key = "ssh-rsa AAAA..."
42+
}
43+
44+
# Add a group
45+
resource "gitlab_group" "sample_group" {
46+
name = "example"
47+
path = "example"
48+
description = "An example group"
49+
}
50+
51+
# Add a project to the group - example/example
52+
resource "gitlab_project" "sample_group_project" {
53+
name = "example"
54+
namespace_id = "${gitlab_group.sample_group.id}"
2955
}
3056
```
3157

r/project.html.markdown

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: "gitlab"
33
page_title: "GitLab: gitlab_project"
44
sidebar_current: "docs-gitlab-resource-project-x"
55
description: |-
6-
Creates and manages projects within Github organizations
6+
Creates and manages projects within Gitlab
77
---
88

99
# gitlab\_project
@@ -15,11 +15,11 @@ GitLab organization.
1515
## Example Usage
1616

1717
```hcl
18-
resource "gitlab_repository" "example" {
18+
resource "gitlab_project" "example" {
1919
name = "example"
2020
description = "My awesome codebase"
2121
22-
visbility_level = "public"
22+
visibility_level = "public"
2323
}
2424
```
2525

@@ -31,6 +31,9 @@ The following arguments are supported:
3131

3232
* `description` - (Optional) A description of the project.
3333

34+
* `namespace_id` - (Optional) The namespace to create this project in.
35+
See [`gitlab_group`](group.html) for an example.
36+
3437
* `default_branch` - (Optional) The default branch for the project.
3538

3639
* `issues_enabled` - (Optional) Enable issue tracking for the project.
@@ -49,6 +52,8 @@ The following arguments are supported:
4952

5053
The following additional attributes are exported:
5154

55+
* `id` - Integer that uniquely identifies the project within the gitlab install.
56+
5257
* `ssh_url_to_repo` - URL that can be provided to `git clone` to clone the
5358
repository via SSH.
5459

0 commit comments

Comments
 (0)