Commit Graph

7 Commits

Author SHA1 Message Date
Łukasz Jan Niemier 18f2edf729 Add namespcace ID attribute (#14483)
* Add namespcace ID attribute

This commit also introduce `id` comouted value which is numeric value
used by GitLab to iteract with repository. This should simplify use of
`gitlab_project_hook` usage and would allow to introduce other resources
as described in #14471

* Fixes requested by @richardc

* Handle optional `namespace_id`
2017-05-24 13:05:27 +01:00
Richard Clamp 9e90e77be4 provider/gitlab: Add `gitlab_group` resource (#14490)
* vendor: Update go-gitlab to master@e6c11e

Update go-gitlab to master@e6c11e.  This brings in UpdateGroup in
addition to fuller management of other attributes.

* provider/gitlab:  Add `gitlab_group` resource

This adds a gitlab_group resource.

This combined with #14483 will allow you to create projects in a
group.
2017-05-24 13:01:24 +01:00
Richard Clamp 395f1d5bbf provider/gitlab: add `gitlab_deploy_key` (#14734)
* provider/gitlab: add `gitlab_deploy_key`

Here we extend the gitlab provider further by adding a `gitlab_deploy_key`
resource.  This resource allows management of a projects deploy
keys.

* provider/gitlab: Do not test `gitlab_deploy_key` `can_push`

Here we remove the testing of the `can_push` attribute.  This makes the
tests less comprehensive, but will allow them to work with the current
release of gitlab-ce.

This change is staged as a distinct commit so it can be easily
dropped/reverted once gitlab MR !11607 has reached a released state.

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11607

* provider/gitlab: Update docs for gitlab_deploy_key/can_push

Note that the can_push attribute of gitlab_deploy_key doesn't currently
work.  This note can be removed once
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11607 is merged
and in general circulation.
2017-05-24 11:41:40 +01:00
stack72 6ea0f6c1fe
provider/gitlab: Adding default values to gitlab_project_hook resource 2017-05-04 19:59:32 +03:00
Richard Clamp dcbe8a4736 provider/gitlab: add gitlab_project_hook resource
Here we add a new resource type `gitlab_project_hook`.  It allows for
management of custom hooks for a gitlab project.

This is a relatively simple resource as a project hook is a simple
association between a project, and a url to hit when one of the flagged
events occurs on that project.

Hooks (called Webhooks in some user documentation, but simply Hooks
in the api documentation) are covered here for users
https://docs.gitlab.com/ce/user/project/integrations/webhooks.html and
in the API documentation at
https://docs.gitlab.com/ce/api/projects.html#hooks
2017-05-03 11:51:53 +01:00
stack72 fd48f91876
provider/gitlab: Addition of the documentation link for gitlab to sidebar
```
% make testacc TEST=./builtin/providers/gitlab
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/04/27 05:37:02 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/gitlab -v  -timeout 120m
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccGitlabProject_basic
--- PASS: TestAccGitlabProject_basic (41.11s)
=== RUN   TestGitlab_validation
--- PASS: TestGitlab_validation (0.00s)
=== RUN   TestGitlab_visbilityHelpers
--- PASS: TestGitlab_visbilityHelpers (0.00s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/gitlab	41.125s
```
2017-04-27 05:44:05 +12:00
Richard Clamp 631b0b865c provider/gitlab: add gitlab provider and `gitlab_project` resource
Here we add a basic provider with a single resource type.

It's copied heavily from the `github` provider and `github_repository`
resource, as there is some overlap in those types/apis.

~~~
resource "gitlab_project" "test1" {
  name = "test1"
  visibility_level = "public"
}
~~~

We implement in terms of the
[go-gitlab](https://github.com/xanzy/go-gitlab) library, which provides
a wrapping of the [gitlab api](https://docs.gitlab.com/ee/api/)

We have been a little selective in the properties we surface for the
project resource, as not all properties are very instructive.
Notable is the removal of the `public` bool as the `visibility_level`
will take precedent if both are supplied which leads to confusing
interactions if they disagree.
2017-04-24 11:38:20 +01:00