Added forking for repository resources to allow creation of repo from a fork

This commit is contained in:
Gavin Bunney
2019-11-01 16:17:49 -07:00
parent c951ecba46
commit 2b986da86b
3 changed files with 106 additions and 37 deletions

View File

@@ -15,17 +15,20 @@ resource "bitbucketserver_repository" "test" {
}
```
###### if you want to fork an existing repository in the same project
### Forking an existing repository
```hcl
resource "bitbucketserver_repository" "test" {
project = "MYPROJ"
name = "test-01"
description = "Test repository"
origin_slug_to_fork = "MYOLDPROJ"
project = "MYPROJ"
name = "test-01"
description = "Test repository"
fork_repository_project = "MY-ORIGIN-PROJ"
fork_repository_slug = "MY-ORIGIN-REPO"
}
```
> Note: Both `fork_repositiroy_project` and `fork_repository_slug` are required to specified the origin repository to fork.
## Argument Reference
* `project` - Required. Name of the project to create the repository in.
@@ -35,7 +38,9 @@ resource "bitbucketserver_repository" "test" {
* `forkable` - Optional. Enable/disable forks of this repository. Default `true`
* `public` - Optional. Determine if this repository is public. Default `false`
* `enable_git_lfs` - Optional. Enable git-lfs for this repository. Default `false`
* `origin_slug_to_fork` - Optional. Use this to fork an expisting repository in the same project. Default `false`
* `fork_repository_project` - Optional. Use this to fork an existing repository from the given project.
* `fork_repository_slug` - Optional. Use this to fork an existing repository from the given repository.
## Attribute Reference
Additional to the above, the following attributes are emitted: