BitBucket Pipelines for Customer Projects
This guide is intended for partners and customers who want to use their own BitBucket as their Git repository and CI/CD tool instead of GitLab.
Before you start, make sure you have sufficient rights in BitBucket.
Select the right Git repository.
Navigate to Repository settings > Pipelines > Repository variables.
Click Variables and create variables PFX_USER and PFX_PASS:
Add the variable PFX_USER and set its value to pfx.deploy and click OK.
Add the variable PFX_PASS and set its value to be a strong password (at least 14 characters, at least 1 digit, at least 1 capital letter). Select Keep this value secret and click OK.
Navigate to Repository settings > Pipelines > Deployments.
Create required environments
For each environments create variable for URL with partition url.
Navigate to Repository settings > Pipelines > Settings.
Enable Pipeline
Click on “Configure bitbucket-pipelines.yml”
Commit the yml file.
Create a feature branch for Pipeline and fetch the yml file in intellij.
Replace the existing code with following:
image: maven:3.6-jdk-11 pipelines: branches: dev: - step: name: dev script: - mvn clean test -e --batch-mode - step: name: Deploy DEV deployment: DEV image: pricefx/pfxpackage script: - pfxpackage -import -timeout 120 -url $URL -user $PFX_USER -password $PFX_PASS -partition {partition-name} -from . $OPTIONS
Replace the {partition-name} with dev partition name.
Create the similar pipeline for other partitions if required.
Add Pom.xml to the project
Add the project as Maven project
Commit the file and create the Pull request.
Create a user account pfx.deploy in the target partitions (QA, PROD) and assign this user the General Admin privileges in each of the partitions where you want to enable deployment and set the password to be identical to the PFX_PASS variable.
After merging the pull request for Pipeline branch with dev branch, Pipeline should start
Notes:
You should set
name
to correspond to your partition, eg.Deploy QA
orDeploy PROD
.You must set the PARTITION and URL variables to the right values of your environment.
See also: Bitbucket Pipelines configuration reference | Bitbucket Cloud | Atlassian Support
Found an issue in documentation? Write to us.