Skip to content

Commit c77e6f0

Browse files
committed
Merge branch 'master' of /Users/jake/terraform
2 parents 7c08ad0 + c007492 commit c77e6f0

File tree

5 files changed

+279
-0
lines changed

5 files changed

+279
-0
lines changed

website/docs/index.html.markdown

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
layout: "gitlab"
3+
page_title: "Provider: GitLab"
4+
sidebar_current: "docs-gitlab-index"
5+
description: |-
6+
The GitLab provider is used to interact with GitLab group or user resources.
7+
---
8+
9+
# GitLab Provider
10+
11+
The GitLab provider is used to interact with GitLab group or user resources.
12+
13+
It needs to be configured with the proper credentials before it can be used.
14+
15+
Use the navigation to the left to read about the available resources.
16+
17+
## Example Usage
18+
19+
```hcl
20+
# Configure the GitLab Provider
21+
provider "gitlab" {
22+
token = "${var.gitlab_token}"
23+
}
24+
25+
# Add a project owned by the user
26+
resource "gitlab_project" "sample_project" {
27+
name = "example"
28+
}
29+
30+
# Add a hook to the project
31+
resource "gitlab_project_hook" "sample_project_hook" {
32+
project = "${gitlab_project.sample_project.id}"
33+
url = "https://example.com/project_hook"
34+
}
35+
36+
# Add a deploy key to the project
37+
resource "gitlab_deploy_key" "sample_deploy_key" {
38+
project = "${gitlab_project.sample_project.id}"
39+
title = "terraform example"
40+
key = "ssh-rsa AAAA..."
41+
}
42+
43+
# Add a group
44+
resource "gitlab_group" "sample_group" {
45+
name = "example"
46+
path = "example"
47+
description = "An example group"
48+
}
49+
50+
# Add a project to the group - example/example
51+
resource "gitlab_project" "sample_group_project" {
52+
name = "example"
53+
namespace_id = "${gitlab_group.sample_group.id}"
54+
}
55+
```
56+
57+
## Argument Reference
58+
59+
The following arguments are supported in the `provider` block:
60+
61+
* `token` - (Optional) This is the GitLab personal access token. It must be provided, but
62+
it can also be sourced from the `GITLAB_TOKEN` environment variable.
63+
64+
* `base_url` - (Optional) This is the target GitLab base API endpoint. Providing a value is a
65+
requirement when working with GitLab CE or GitLab Enterprise e.g. https://my.gitlab.server/api/v3/.
66+
It is optional to provide this value and it can also be sourced from the `GITLAB_BASE_URL` environment variable.
67+
The value must end with a slash.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
layout: "gitlab"
3+
page_title: "GitLab: gitlab_deploy_key"
4+
sidebar_current: "docs-gitlab-resource-deploy_key"
5+
description: |-
6+
Creates and manages deploy keys for GitLab projects
7+
---
8+
9+
# gitlab\_deploy\_key
10+
11+
This resource allows you to create and manage deploy keys for your GitLab projects.
12+
13+
14+
## Example Usage
15+
16+
```hcl
17+
resource "gitlab_deploy_key" "example" {
18+
project = "example/deploying"
19+
title = "Example deploy key"
20+
key = "ssh-rsa AAAA..."
21+
}
22+
```
23+
24+
## Argument Reference
25+
26+
The following arguments are supported:
27+
28+
* `project` - (Required, string) The name or id of the project to add the deploy key to.
29+
30+
* `title` - (Required, string) A title to describe the deploy key with.
31+
32+
* `key` - (Required, string) The public ssh key body.
33+
34+
* `can_push` - (Optional, boolean) Allow this deploy key to be used to push changes to the project. Defaults to `false`. **NOTE::** this cannot currently be managed.

website/docs/r/group.html.markdown

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
layout: "gitlab"
3+
page_title: "GitLab: gitlab_group"
4+
sidebar_current: "docs-gitlab-resource-group"
5+
description: |-
6+
Creates and manages GitLab groups
7+
---
8+
9+
# gitlab\_group
10+
11+
This resource allows you to create and manage GitLab groups.
12+
Note your provider will need to be configured with admin-level access for this resource to work.
13+
14+
## Example Usage
15+
16+
```hcl
17+
resource "gitlab_group" "example" {
18+
name = "example"
19+
path = "example"
20+
description = "An example group"
21+
}
22+
23+
// Create a project in the example group
24+
resource "gitlab_project" "example" {
25+
name = "example"
26+
description = "An example project"
27+
namespace_id = "${gitlab_group.example.id}"
28+
}
29+
```
30+
31+
## Argument Reference
32+
33+
The following arguments are supported:
34+
35+
* `name` - (Required) The name of this group.
36+
37+
* `path` - (Required) The url of the hook to invoke.
38+
39+
* `description` - (Optional) The description of the group.
40+
41+
* `lfs_enabled` - (Optional) Boolean, defaults to true. Whether to enable LFS
42+
support for projects in this group.
43+
44+
* `request_access_enabled` - (Optional) Boolean, defaults to false. Whether to
45+
enable users to request access to the group.
46+
47+
* `visibility_level` - (Optional) Set to `public` to create a public group.
48+
Valid values are `private`, `internal`, `public`.
49+
Groups are created as private by default.
50+
51+
## Attributes Reference
52+
53+
The resource exports the following attributes:
54+
55+
* `id` - The unique id assigned to the group by the GitLab server. Serves as a
56+
namespace id where one is needed.

website/docs/r/project.html.markdown

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
layout: "gitlab"
3+
page_title: "GitLab: gitlab_project"
4+
sidebar_current: "docs-gitlab-resource-project-x"
5+
description: |-
6+
Creates and manages projects within GitLab groups or within your user
7+
---
8+
9+
# gitlab\_project
10+
11+
This resource allows you to create and manage projects within your
12+
GitLab group or within your user.
13+
14+
15+
## Example Usage
16+
17+
```hcl
18+
resource "gitlab_project" "example" {
19+
name = "example"
20+
description = "My awesome codebase"
21+
22+
visibility_level = "public"
23+
}
24+
```
25+
26+
## Argument Reference
27+
28+
The following arguments are supported:
29+
30+
* `name` - (Required) The name of the project.
31+
32+
* `namespace_id` - (Optional) The namespace (group or user) of the project. Defaults to your user.
33+
See [`gitlab_group`](group.html) for an example.
34+
35+
* `description` - (Optional) A description of the project.
36+
37+
* `default_branch` - (Optional) The default branch for the project.
38+
39+
* `issues_enabled` - (Optional) Enable issue tracking for the project.
40+
41+
* `merge_requests_enabled` - (Optional) Enable merge requests for the project.
42+
43+
* `wiki_enabled` - (Optional) Enable wiki for the project.
44+
45+
* `snippets_enabled` - (Optional) Enable snippets for the project.
46+
47+
* `visibility_level` - (Optional) Set to `public` to create a public project.
48+
Valid values are `private`, `internal`, `public`.
49+
Repositories are created as private by default.
50+
51+
## Attributes Reference
52+
53+
The following additional attributes are exported:
54+
55+
* `id` - Integer that uniquely identifies the project within the gitlab install.
56+
57+
* `ssh_url_to_repo` - URL that can be provided to `git clone` to clone the
58+
repository via SSH.
59+
60+
* `http_url_to_repo` - URL that can be provided to `git clone` to clone the
61+
repository via HTTP.
62+
63+
* `web_url` - URL that can be used to find the project in a browser.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
layout: "gitlab"
3+
page_title: "GitLab: gitlab_project_hook"
4+
sidebar_current: "docs-gitlab-resource-project-hook"
5+
description: |-
6+
Creates and manages hooks for GitLab projects
7+
---
8+
9+
# gitlab\_project\_hook
10+
11+
This resource allows you to create and manage hooks for your GitLab projects.
12+
For further information on hooks, consult the [gitlab
13+
documentation](https://docs.gitlab.com/ce/user/project/integrations/webhooks.html).
14+
15+
16+
## Example Usage
17+
18+
```hcl
19+
resource "gitlab_project_hook" "example" {
20+
project = "example/hooked"
21+
url = "https://example.com/hook/example"
22+
merge_requests_events = true
23+
}
24+
```
25+
26+
## Argument Reference
27+
28+
The following arguments are supported:
29+
30+
* `project` - (Required) The name or id of the project to add the hook to.
31+
32+
* `url` - (Required) The url of the hook to invoke.
33+
34+
* `token` - (Optional) A token to present when invoking the hook.
35+
36+
* `enable_ssl_verification` - (Optional) Enable ssl verification when invoking
37+
the hook.
38+
39+
* `push_events` - (Optional) Invoke the hook for push events.
40+
41+
* `issues_events` - (Optional) Invoke the hook for issues events.
42+
43+
* `merge_requests_events` - (Optional) Invoke the hook for merge requests.
44+
45+
* `tag_push_events` - (Optional) Invoke the hook for tag push events.
46+
47+
* `note_events` - (Optional) Invoke the hook for tag push events.
48+
49+
* `build_events` - (Optional) Invoke the hook for build events.
50+
51+
* `pipeline_events` - (Optional) Invoke the hook for pipeline events.
52+
53+
* `wiki_page_events` - (Optional) Invoke the hook for wiki page events.
54+
55+
## Attributes Reference
56+
57+
The resource exports the following attributes:
58+
59+
* `id` - The unique id assigned to the hook by the GitLab server.

0 commit comments

Comments
 (0)