In the examples below, you create blocks with Python code.
Alternatively, blocks can be created through the Prefect UI.
Store deployment flow code in a private Bitbucket repository¶
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:
The repository is public
The deployment uses a Secret block to store the token
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.
Access flow code stored in a private Bitbucket repository in a deployment¶
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.