xvlcwk 4a1db57661 feat(#4) Add resource_repository_deploy_key
Allows to add an ssh key to a given repository.

This should allow to make build servers with more restricted access
controls.
2024-01-13 23:29:51 +01:00
2019-10-08 10:12:21 -07:00
2022-06-16 10:22:15 -07:00

Bitbucket Server Terraform Provider

user guide

This terraform provider allows management of Bitbucket Server resources. The bundled terraform bitbucket provider works only for Bitbucket Cloud.

Using the provider

Download a binary for your system from the release page and remove the -os-arch details so you're left with terraform-provider-bitbucketserver. Use chmod +x to make it executable and then either place it at the root of your Terraform folder or in the Terraform plugin folder on your system.

Example

provider "bitbucketserver" {
  server   = "https://mybitbucket.example.com"
  username = "admin"
  password = "password"
}

resource "bitbucketserver_project" "test" {
  key         = "TEST"
  name        = "test-01"
  description = "Test project"
}

resource "bitbucketserver_repository" "test" {
  project     = bitbucketserver_project.test.key
  name        = "test-01"
  description = "Test repository"
}

Development Guide

Requirements

Building the provider

To build the provider, run make build. This will also put the provider binary in the $GOPATH/bin directory.

$ make build

Testing

In order to test the provider, you can simply run make test.

$ make test

In order to run the full suite of acceptance tests, run make testacc-bitbucket.

$ make testacc-bitbucket

Alternatively, you can manually start Bitbucket Server docker container, run the acceptance tests and then shut down the docker.

$ scripts/start-docker-compose.sh
$ make testacc
$ scripts/stop-docker-compose.sh
Description
No description provided
Readme MPL-2.0 652 KiB
Latest
2025-05-27 11:03:33 +02:00
Languages
Go 97.5%
Shell 1.7%
Makefile 0.8%