Bitbucket Cloud
1. Create an OAuth consumer
To integrate your Upsun project with an existing Bitbucket Cloud repository, create an OAuth consumer:Be sure to define the above as a private consumer by checking the This is a private consumer box.
http://localhost.
Copy the Key and Secret for your consumer.
2. Enable the Cloud integration
To enable the integration, use either the CLI or the Console.- Using the CLI
- In the Console
Run the following command:
PROJECT_IDis the ID of your Upsun project.OWNER/REPOSITORYis the name of your repository in Bitbucket.CONSUMER_KEYis the key of the OAuth consumer you created.CONSUMER_SECRETis the secret of the OAuth consumer you created.
https://bitbucket.org/platformsh/platformsh-docs,
the command is similar to the following:| CLI flag | Default | Description |
|---|---|---|
fetch-branches | true | Whether to mirror and update branches on Upsun and create inactive environments from them. When enabled, merging on an Upsun environment isn’t possible. That is, merging environments must be done on the source repository rather than on the Upsun project. See note below for details related to this flag and synchronizing code from a parent environment. |
prune-branches | true | Whether to delete branches from Upsun that don’t exist in the Bitbucket repository. When enabled, branching (creating environments) must be done on the source repository rather than on the Upsun project. Branches created on Upsun that are not on the source repository will not persist and will be quickly pruned. Automatically disabled when fetching branches is disabled. |
build-pull-requests | true | Whether to track all pull requests and create active environments from them, which builds the pull request. |
resync-pull-requests | false | Whether to sync data from the parent environment on every push to a pull request. |
resources-init | false | To specify a resource initialization strategy for new containers. Once set, the strategy applies to all the deployments you launch through your source integration. See more information on available resource initialization strategies. |
To keep your repository clean and avoid performance issues, make sure you enable both the
fetch-branches and prune-branches options.