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
This commit is contained in:
Richard Clamp 2017-05-29 15:04:51 +01:00 committed by Paul Stack
parent 3dbc83e64b
commit 8e25c23c84
2 changed files with 36 additions and 5 deletions

View File

@ -23,9 +23,35 @@ provider "gitlab" {
token = "${var.gitlab_token}"
}
# Add a project to the organization
# Add a project owned by the user
resource "gitlab_project" "sample_project" {
...
name = "example"
}
# Add a hook to the project
resource "gitlab_project_hook" "sample_project_hook" {
project = "${gitlab_project.sample_project.id}"
url = "https://example.com/project_hook"
}
# Add a deploy key to the project
resource "gitlab_deploy_key" "sample_deploy_key" {
project = "${gitlab_project.sample_project.id}"
title = "terraform example"
key = "ssh-rsa AAAA..."
}
# Add a group
resource "gitlab_group" "sample_group" {
name = "example"
path = "example"
description = "An example group"
}
# Add a project to the group - example/example
resource "gitlab_project" "sample_group_project" {
name = "example"
namespace_id = "${gitlab_group.sample_group.id}"
}
```

View File

@ -3,7 +3,7 @@ layout: "gitlab"
page_title: "GitLab: gitlab_project"
sidebar_current: "docs-gitlab-resource-project-x"
description: |-
Creates and manages projects within Github organizations
Creates and manages projects within Gitlab
---
# gitlab\_project
@ -15,11 +15,11 @@ GitLab organization.
## Example Usage
```hcl
resource "gitlab_repository" "example" {
resource "gitlab_project" "example" {
name = "example"
description = "My awesome codebase"
visbility_level = "public"
visibility_level = "public"
}
```
@ -31,6 +31,9 @@ The following arguments are supported:
* `description` - (Optional) A description of the project.
* `namespace_id` - (Optional) The namespace to create this project in.
See [`gitlab_group`](group.html) for an example.
* `default_branch` - (Optional) The default branch for the project.
* `issues_enabled` - (Optional) Enable issue tracking for the project.
@ -49,6 +52,8 @@ The following arguments are supported:
The following additional attributes are exported:
* `id` - Integer that uniquely identifies the project within the gitlab install.
* `ssh_url_to_repo` - URL that can be provided to `git clone` to clone the
repository via SSH.