Moved all docs to website

This commit is contained in:
Gavin Bunney
2019-10-14 15:50:22 -07:00
parent 08d0f58674
commit 0ec65e856a
28 changed files with 601 additions and 421 deletions

373
README.md
View File

@@ -34,378 +34,7 @@ resource "bitbucketserver_repository" "test" {
}
```
### Provider Configuration
The provider supports parameters to determine the bitbucket server and admin user/password to use.
```hcl
provider "bitbucketserver" {
server = "https://mybitbucket.example.com"
username = "admin"
password = "password"
}
```
You can also specify these parameters through the `BITBUCKET_SERVER`, `BITBUCKER_USERNAME` and `BITBUCKET_PASSWORD` environment variables.
### Create a Bitbucket Project
```hcl
resource "bitbucketserver_project" "test" {
key = "TEST"
name = "test-01"
description = "Test project"
avatar = "data:(content type, e.g. image/png);base64,(data)"
}
```
* `key` - Required. Project key to set.
* `name` - Required. Name of the project.
* `description` - Optional. Description of the project.
* `avatar` - Optional. Avatar to use containing base64-encoded image data. Format: `data:(content type, e.g. image/png);base64,(data)`
#### Import Project
```bash
$ terraform import bitbucketserver_project.test TEST
```
### Assign Project Permissions for Group
```hcl
resource "bitbucketserver_project_permissions_group" "test" {
project = "TEST"
group = "stash-users"
permission = "PROJECT_WRITE"
}
```
* `project` - Required. Project key to set permissions for.
* `group` - Required. Name of the group permissions are for.
* `permission` - Required. The permission to grant. Available project permissions are: `PROJECT_READ`, `PROJECT_WRITE`, `PROJECT_ADMIN`
#### Import Group Permission for Project
```bash
$ terraform import bitbucketserver_project_permissions_group.test TEST/stash-users
```
### Assign Project Permissions for User
```hcl
resource "bitbucketserver_project_permissions_user" "test" {
project = "TEST"
user = "admin"
permission = "PROJECT_WRITE"
}
```
* `project` - Required. Project key to set permissions for.
* `user` - Required. Name of the user permissions are for.
* `permission` - Required. The permission to grant. Available project permissions are: `PROJECT_READ`, `PROJECT_WRITE`, `PROJECT_ADMIN`
#### Import Group Permission for Project
```bash
$ terraform import bitbucketserver_project_permissions_user.test TEST/admin
```
### Create a Bitbucket Repository
```hcl
resource "bitbucketserver_repository" "test" {
name = "test-01"
description = "Test repository"
}
```
* `name` - Required. Name of the project.
* `slug` - Optional. Slug to use for the repository. Calculated if not defined.
* `description` - Optional. Description of the repository.
* `forkable` - Optional. Enable/disable forks of this repository. Default `true`
* `public` - Optional. Determine if this repository is public. Default `false`
#### Attributes
Additional to the above, the following attributes are emitted:
* `clone_ssh` - URL for SSH cloning of the repository.
* `clone_https` - URL for HTTPS cloning of the repository.
#### Import Repository
```bash
$ terraform import bitbucketserver_repository.test TEST/test-01
```
### Assign Repository Permissions for Group
```hcl
resource "bitbucketserver_repository_permissions_group" "test" {
project = "TEST"
repository = "my-repo"
group = "stash-users"
permission = "REPO_WRITE"
}
```
* `project` - Required. Project key to set permissions for.
* `repository` - Required. Repository slug to set permissions for.
* `group` - Required. Name of the group permissions are for.
* `permission` - Required. The permission to grant. Available repository permissions are: `REPO_READ`, `REPO_WRITE`, `REPO_ADMIN`
#### Import Group Permission for Repository
```bash
$ terraform import bitbucketserver_repository_permissions_group.test TEST/my-repo/stash-users
```
### Assign Repository Permissions for User
```hcl
resource "bitbucketserver_repository_permissions_user" "test" {
project = "TEST"
repository = "my-repo"
user = "admin"
permission = "REPO_WRITE"
}
```
* `project` - Required. Project key to set permissions for.
* `user` - Required. Name of the user permissions are for.
* `permission` - Required. The permission to grant. Available repository permissions are: `REPO_READ`, `REPO_WRITE`, `REPO_ADMIN`
#### Import Group Permission for Repository
```bash
$ terraform import bitbucketserver_repository_permissions_user.test TEST/my-repo/admin
```
### Create a Bitbucket User
```hcl
resource "bitbucketserver_user" "admin" {
name = "mreynolds"
display_name = "Malcolm Reynolds"
email_address = "browncoat@example.com"
}
```
* `name` - Required. Username of the user.
* `display_name` - Required. User's name to display.
* `email_address` - Required. Email address of user.
* `password_length` - Optional. The length of the generated password on resource creation. Only applies on resource creation. Default `20`.
#### Attributes
Additional to the above, the following attributes are emitted:
* `initial_password` - The generated user password. Only available if password was handled on Terraform resource creation, not import.
#### Import User
```bash
$ terraform import bitbucketserver_user.test mreynolds
```
### Create a Bitbucket Group
```hcl
resource "bitbucketserver_group" "browncoats" {
name = "browncoats"
}
```
* `name` - Required. Group to create.
#### Import Group
```bash
$ terraform import bitbucketserver_group.test browncoats
```
### Assign a User to a Bitbucket Group
```hcl
resource "bitbucketserver_user_group" "browncoat" {
user = "mreynolds"
group = "browncoats"
}
```
* `user` - Required. User to assign group to.
* `group` - Required. Group to assign to the user.
#### Import Group
```bash
$ terraform import bitbucketserver_user_group.browncoat mreynolds/browncoats
```
### Assign Global Permissions for Group
```hcl
resource "bitbucketserver_global_permissions_group" "test" {
project = "TEST"
group = "stash-users"
permission = "ADMIN"
}
```
* `group` - Required. Name of the group permissions are for.
* `permission` - Required. The permission to grant. Available project permissions are: `LICENSED_USER`, `PROJECT_CREATE`, `ADMIN`, `SYS_ADMIN`
#### Import Global Group Permissions
```bash
$ terraform import bitbucketserver_global_permissions_group.test my-group
```
### Assign Global Permissions for User
```hcl
resource "bitbucketserver_project_permissions_user" "test" {
user = "admin"
permission = "ADMIN"
}
```
* `user` - Required. Name of the user permissions are for.
* `permission` - Required. The permission to grant. Available project permissions are: `LICENSED_USER`, `PROJECT_CREATE`, `ADMIN`, `SYS_ADMIN`
#### Import Global Group Permissions
```bash
$ terraform import bitbucketserver_global_permissions_user.test my-user
```
### Install and License Plugins
Install plugins, manage enabled state and set license details.
```hcl
resource "bitbucketserver_plugin" "myplugin" {
key = "com.example-my-plugin"
version = "1.2.3"
license = "ABCDEF"
}
```
* `key` - Required. Unique key of the plugin.
* `version` - Required. Version to install.
* `license` - Optional. License to apply to the plugin.
* `enabled` - Optional, default `true`. Flag to enable/disable the plugin.
#### Attributes
Additional to the above, the following attributes are emitted:
* `enabled_by_default` - Set to `true` if the plugin is enabled by default (for system plugins).
* `version` - Installed version of the plugin.
* `name` - Name of the plugin.
* `description` - Plugin description.
* `user_installed` - Set to `true` if this is a user installed plugin vs a system bundled plugin.
* `optional` - Set to `true` if this is an optional plugin.
* `vendor.name` - Name of the vendor.
* `vendor.link` - Vendor homepage.
* `vendor.marketplace_link` - Plugin marketplace link.
* `applied_license.0.valid` - Is the license valid. true/false.
* `applied_license.0.evaluation` - Is the license an evaluation. true/false.
* `applied_license.0.nearly_expired` - Is the license nearly expired. true/false.
* `applied_license.0.maintenance_expiry_date` - Date of maintenance expiry.
* `applied_license.0.maintenance_expired` - Is the maintenance expired. true/false.
* `applied_license.0.license_type` - Type of license.
* `applied_license.0.expiry_date` - Expiry date of the license.
* `applied_license.0.raw_license` - The raw license information.
* `applied_license.0.renewable` - Is the license renewabl. true/false.
* `applied_license.0.organization_name` - Name of the organization the license is for.
* `applied_license.0.enterprise` - Is the license for enterprise. true/false.
* `applied_license.0.data_center` - Is the license for data center. true/false.
* `applied_license.0.subscription` - Is the license a subscription. true/false.
* `applied_license.0.active` - Is the license active. true/false.
* `applied_license.0.auto_renewal` - Is the license renewed automatically. true/false.
* `applied_license.0.upgradable` - Is the license able to be upgraded. true/false.
* `applied_license.0.crossgradeable` - Can the license be crossgraded. true/false.
* `applied_license.0.purchase_past_server_cutoff_date` - The purchase date past the server cutoff date. true/false.
#### Import Plugin
```bash
$ terraform import bitbucketserver_plugin.test com.example-my-plugin
```
### Set Server License
```hcl
resource "bitbucketserver_license" "main" {
license = "AAACLg0ODAoPeNqNVEtv4jAQvudXRNpbp"
}
```
* `license` - Required. License to apply.
#### Attributes
Additional to the above, the following attributes are emitted:
* `clone_ssh` - URL for SSH cloning of the repository.
* `clone_https` - URL for HTTPS cloning of the repository.
* `creation_date` - License creation date.
* `purchase_date` - License purchase date.
* `expiry_date` - Expiry date of the license.
* `maintenance_expiry_date` - Expiry date of the maintenance period.
* `grace_period_end_date` - Grace period beyond expiry date.
* `maximum_users` - Maximum number of users for license.
* `unlimited_users` - Boolean flag if this is an unlimited user license.
* `server_id` - Server ID.
* `support_entitlement_number` - Entitlement number for support requests.
#### Import License
```bash
$ terraform import bitbucketserver_license.main license
```
### Set Mail Server Configuration
```hcl
resource "bitbucketserver_mail_server" "mail" {
hostname = "mail.example.com"
port = 465
protocol = "SMTPS"
sender_address = "bitbucket@example.com"
}
```
* `hostname` - Required. Hostname of the mail server.
* `port` - Required. Port number of the mail server. Typically port 25 or 587 for SMTP and 465 for SMTPS.
* `sender_address` - Required. Email address for notification emails.
* `protocol` - Optional. SMTP or SMTPS supported. Default `SMTP`
* `use_start_tls` - Optional. Use SSL/TLS if available. Default `true`
* `require_start_tls` - Optional. Require SSL to be used. Default `false`
* `username` - Optional. User to connect with.
* `password` - Optional. User to connect with.
#### Import Mail Configuration
```bash
$ terraform import bitbucketserver_mail_server.mail mail.example.com
```
See [User Guide](https://gavinbunney.github.io/terraform-provider-bitbucketserver) for details on all the provided data and resource types.
---