-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bitbucket datacenter (server) support (#2503)
This pull-requests re-introduces the Bitbucket Server support with a more or less complete rewrite of the forge implementation. We have a lot of on-premises git repositories hosted in Bitbucket Server and need a CI solution for running that and Woodpecker looks promising. The implementation is based on external Bitbucket Server REST client library which we are maintaining and have created in another context. Besides the original support for Bitbucket the re-implementation also adds support for handling Bitbucket pull-request events.
- Loading branch information
Showing
16 changed files
with
1,536 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
docs/docs/30-administration/11-forges/60-bitbucket_datacenter.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
--- | ||
toc_max_heading_level: 2 | ||
--- | ||
|
||
# Bitbucket Datacenter / Server | ||
|
||
:::warning | ||
Woodpecker comes with experimental support for Bitbucket Datacenter / Server, formerly known as Atlassian Stash. | ||
::: | ||
|
||
To enable Bitbucket Server you should configure the Woodpecker container using the following environment variables: | ||
|
||
```diff | ||
# docker-compose.yml | ||
version: '3' | ||
|
||
services: | ||
woodpecker-server: | ||
[...] | ||
environment: | ||
- [...] | ||
+ - WOODPECKER_BITBUCKET_DC=true | ||
+ - WOODPECKER_BITBUCKET_DC_GIT_USERNAME=foo | ||
+ - WOODPECKER_BITBUCKET_DC_GIT_PASSWORD=bar | ||
+ - WOODPECKER_BITBUCKET_DC_CLIENT_ID=xxx | ||
+ - WOODPECKER_BITBUCKET_DC_CLIENT_SECRET=yyy | ||
+ - WOODPECKER_BITBUCKET_DC_URL=http://stash.mycompany.com | ||
|
||
woodpecker-agent: | ||
[...] | ||
``` | ||
|
||
## Service Account | ||
|
||
Woodpecker uses `git+https` to clone repositories, however, Bitbucket Server does not currently support cloning repositories with an OAuth token. To work around this limitation, you must create a service account and provide the username and password to Woodpecker. This service account will be used to authenticate and clone private repositories. | ||
|
||
## Registration | ||
|
||
Woodpecker must be registered with Bitbucket Datacenter / Server. In the administration section of Bitbucket choose "Application Links" and then "Create link". Woodpecker should be listed as "External Application" and the direction should be set to "Incomming". Note the client id and client secret of the registration to be used in the configuration of Woodpecker. | ||
|
||
See also [Configure an incoming link](https://confluence.atlassian.com/bitbucketserver/configure-an-incoming-link-1108483657.html). | ||
|
||
## Configuration | ||
|
||
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations. | ||
|
||
### `WOODPECKER_BITBUCKET_DC` | ||
|
||
> Default: `false` | ||
Enables the Bitbucket Server driver. | ||
|
||
### `WOODPECKER_BITBUCKET_DC_URL` | ||
|
||
> Default: empty | ||
Configures the Bitbucket Server address. | ||
|
||
### `WOODPECKER_BITBUCKET_DC_CLIENT_ID` | ||
|
||
> Default: empty | ||
Configures your Bitbucket Server OAUth 2.0 client id. | ||
|
||
### `WOODPECKER_BITBUCKET_DC_CLIENT_SECRET` | ||
|
||
> Default: empty | ||
Configures your Bitbucket Server OAUth 2.0 client secret. | ||
|
||
### `WOODPECKER_BITBUCKET_DC_GIT_USERNAME` | ||
|
||
> Default: empty | ||
This username is used to authenticate and clone all private repositories. | ||
|
||
### `WOODPECKER_BITBUCKET_DC_GIT_USERNAME_FILE` | ||
|
||
> Default: empty | ||
Read the value for `WOODPECKER_BITBUCKET_DC_GIT_USERNAME` from the specified filepath | ||
|
||
### `WOODPECKER_BITBUCKET_DC_GIT_PASSWORD` | ||
|
||
> Default: empty | ||
The password is used to authenticate and clone all private repositories. | ||
|
||
### `WOODPECKER_BITBUCKET_DC_GIT_PASSWORD_FILE` | ||
|
||
> Default: empty | ||
Read the value for `WOODPECKER_BITBUCKET_DC_GIT_PASSWORD` from the specified filepath | ||
|
||
### `WOODPECKER_BITBUCKET_DC_SKIP_VERIFY` | ||
|
||
> Default: `false` | ||
Configure if SSL verification should be skipped. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.