Configure an agent with Bitbucket Cloud access
In order to view recipe results and commit changes from a recipe back to Bitbucket, you'll need to create an application link in Bitbucket and configure the Moderne agent with the appropriate variables.
To assist with that, this guide will:
- Walk you through how to configure your Bitbucket Cloud instance to support the agent
- Provide you with a list of necessary variables the agent needs to communicate with your Bitbucket instance
Prerequisites
- You will need access to create a Bitbucket OAuth Consumer
Bitbucket configuration
Step 1: Create a Bitbucket OAuth Consumer
Follow this Atlassian guide to create an OAuth Consumer.
Once that's done, configure the callback URL to point at your Moderne tenant:
The consumer should have these permissions:
- Projects - Read
- Repositories - Write
- Pull requests - Write
Once your consumer has been created, you should see a key
and a secret
:
Please save those for use in Step 2.
Agent configuration
Step 2: Configure the Moderne agent
The following table contains all of the variables/arguments you need to add to your Moderne agent run command in order for it to work with your Bitbucket instance. Please note that these variables/arguments must be combined with ones found in other steps in the Configuring the Moderne agent guide.
- OCI Container
- Executable JAR
Variables:
Variable Name | Required | Default | Description |
---|---|---|---|
MODERNE_AGENT_BITBUCKET_CLOUD_OAUTH_KEY | true | The key specified in your Bitbucket OAuth consumer. | |
MODERNE_AGENT_BITBUCKET_CLOUD_OAUTH_SECRET | true | The secret specified in your Bitbucket OAuth consumer. |
Example:
docker run \
# ... Existing variables
-e MODERNE_AGENT_BITBUCKET_CLOUD_OAUTH_KEY=yourOAuthKey \
-e MODERNE_AGENT_BITBUCKET_CLOUD_OAUTH_SECRET=yourSecretKey \
# ... Additional variables
Arguments:
Argument Name | Required | Default | Description |
---|---|---|---|
--moderne.agent.bitbucket.cloud.oauthKey | true | The key specified in your Bitbucket OAuth consumer. | |
--moderne.agent.bitbucket.cloud.oauthSecret | true | The secret specified in your Bitbucket OAuth consumer. |
Example:
java -jar moderne-agent-{version}.jar \
# ... Existing arguments
--moderne.agent.bitbucket.cloud.oauthKey=yourOAuthKey \
--moderne.agent.bitbucket.cloud.oauthSecret=yourSecretKey \
# ... Additional arguments