The prefect-bitbucket
library makes it easy to interact with Bitbucket repositories and credentials.
prefect-bitbucket
The following command will install a version of prefect-bitbucket
compatible with your installed version of prefect
.
If you don’t already have prefect
installed, it will install the newest version of prefect
as well.
Upgrade to the latest versions of prefect
and prefect-bitbucket
:
Register the block types in the prefect-bitbucket
module to make them available for use.
In the examples below, you create blocks with Python code. Alternatively, blocks can be created through the Prefect UI.
To create a deployment and run a deployment where the flow code is stored in a private Bitbucket repository, you can use the BitBucketCredentials
block.
A deployment can use flow code stored in a Bitbucket repository without using this library in either of the following cases:
Create a Bitbucket Credentials block:
Difference between Bitbucket Server and Bitbucket Cloud authentication
If using a token to authenticate to Bitbucket Cloud, only set the token
to authenticate. Do not include a value in the username
field or authentication will fail. If using Bitbucket Server, provide both the token
and username
values.
Use the credentials block you created above to pass the Bitbucket access token during deployment creation. The code below assumes there’s flow code stored in a private Bitbucket repository.
Alternatively, if you use a prefect.yaml
file to create the deployment, reference the Bitbucket Credentials block in the pull
step:
The code below shows how to reference a particular branch or tag of a Bitbucket repository.
Exclude the reference
field to use the default branch.
Reference a BitBucketCredentials block for authentication if the repository is private.
Use the newly created block to interact with the Bitbucket repository.
For example, download the repository contents with the .get_directory()
method like this:
For assistance using Bitbucket, consult the Bitbucket documentation.
Refer to the prefect-bitbucket
SDK documentation to explore all the capabilities of the prefect-bitbucket
library.
The prefect-bitbucket
library makes it easy to interact with Bitbucket repositories and credentials.
prefect-bitbucket
The following command will install a version of prefect-bitbucket
compatible with your installed version of prefect
.
If you don’t already have prefect
installed, it will install the newest version of prefect
as well.
Upgrade to the latest versions of prefect
and prefect-bitbucket
:
Register the block types in the prefect-bitbucket
module to make them available for use.
In the examples below, you create blocks with Python code. Alternatively, blocks can be created through the Prefect UI.
To create a deployment and run a deployment where the flow code is stored in a private Bitbucket repository, you can use the BitBucketCredentials
block.
A deployment can use flow code stored in a Bitbucket repository without using this library in either of the following cases:
Create a Bitbucket Credentials block:
Difference between Bitbucket Server and Bitbucket Cloud authentication
If using a token to authenticate to Bitbucket Cloud, only set the token
to authenticate. Do not include a value in the username
field or authentication will fail. If using Bitbucket Server, provide both the token
and username
values.
Use the credentials block you created above to pass the Bitbucket access token during deployment creation. The code below assumes there’s flow code stored in a private Bitbucket repository.
Alternatively, if you use a prefect.yaml
file to create the deployment, reference the Bitbucket Credentials block in the pull
step:
The code below shows how to reference a particular branch or tag of a Bitbucket repository.
Exclude the reference
field to use the default branch.
Reference a BitBucketCredentials block for authentication if the repository is private.
Use the newly created block to interact with the Bitbucket repository.
For example, download the repository contents with the .get_directory()
method like this:
For assistance using Bitbucket, consult the Bitbucket documentation.
Refer to the prefect-bitbucket
SDK documentation to explore all the capabilities of the prefect-bitbucket
library.