mirror of
https://github.com/ysoftdevs/terraform-provider-bitbucketserver.git
synced 2026-03-21 00:49:10 +01:00
Add a resource for webhook (#40)
Authored-by: Raul Barreto <raul.barreto@redbull.com>
This commit is contained in:
committed by
GitHub
parent
8e94aeb33c
commit
f7325bc723
47
docs/resources/bitbucketserver_repository_webhook.md
Normal file
47
docs/resources/bitbucketserver_repository_webhook.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Resource: bitbucketserver_repository_webhook
|
||||
|
||||
Manage a repository level hook. Extends what Bitbucket does every time a repository changes, for example when code is pushed or a pull request is merged.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```hcl
|
||||
resource "bitbucketserver_project" "main" {
|
||||
key = "MYPROJ"
|
||||
name = "my-project"
|
||||
}
|
||||
|
||||
resource "bitbucketserver_repository" "main" {
|
||||
project = bitbucketserver_project.test.key
|
||||
name = "repo"
|
||||
}
|
||||
|
||||
resource "bitbucketserver_repository_webhook" "main" {
|
||||
project = bitbucketserver_project.test.key
|
||||
repository = bitbucketserver_repository.test.slug
|
||||
name = "google"
|
||||
webhook_url = "https://www.google.com/"
|
||||
events = ["repo:refs_changed"]
|
||||
active = true
|
||||
}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
* `project` - Required. Project Key the repository is contained within.
|
||||
* `repository` - Required. Repository slug to enable hook for.
|
||||
* `name` - Required. Name of the webhook.
|
||||
* `webhook_url` - Required. The URL of the webhook.
|
||||
* `events` - Required. A list of events to trigger the webhook url.
|
||||
* `active` - Optional. Enable or disable the webhook. Default: true
|
||||
|
||||
## Attribute Reference
|
||||
|
||||
* `webhook_id` - The webhook id.
|
||||
|
||||
## Import
|
||||
|
||||
Import a user reference using the project key, repository name and webhook name.
|
||||
|
||||
```
|
||||
terraform import bitbucketserver_repository_webhook.main MYPROJ/repo/google
|
||||
```
|
||||
Reference in New Issue
Block a user