BitBucket Pipelines for Customer Projects

Important: Starting with pfxpackage v3.41+, you must include run-as-user: 0 in the pipeline step that uses the pricefx/pfxpackage image. Add it under that step's configuration; otherwise, logs will not be printed in Bitbucket. See Docker image options: Run as user

This guide is for partners and customers who want to use their own Bitbucket as the Git repository and CI/CD tool instead of GitLab.

Prerequisites

  • Create a user account pfx.deploy in the target partitions (QA, PROD). Assign General Admin privileges in each partition where you plan to deploy. Set a password and keep it safe; you will set it later in the PFX_PASS variable in Bitbucket.

The password must be at least 14 characters long, have at least 1 digit, and have at least 1 capital letter.

  • pom.xml must be present in the project root folder. If not, generate it in Studio by right-clicking the project and navigating to Pricefx > Create 'pom.xml'.

  • Ensure you have sufficient permissions in Bitbucket to manage the repository settings.

Step-by-step tutorial in Bitbucket

  1. Configure repository variables. Navigate to Repository settings > Pipelines > Repository variables and add:

    1. PFX_USER — set to pfx.deploy.

    2. PFX_PASS — set to the deployment user's password. Select Keep this value secret.

  2. Configure environments. Navigate to Repository settings > Pipelines > Deployments. Create all environments. The names must match those from the config.json file.

  3. Generate the pipeline file in Studio. Right-click the project and navigate to Pricefx > CI Deployment > Create bitbucket-pipelines.yml. Map each source branch to its target environment (cluster URL and partition are derived from the mapping). Commit and push the generated file to your Bitbucket repository.

You're all set. From now on:

  • A pull request runs Verify (Maven unit tests) and Analyze (pfxprobe code analysis).

  • A push to a mapped branch runs Verify, Analyze, and Deploy (pfxpackage tool) to the target partition.

See also: https://support.atlassian.com/bitbucket-cloud/docs/bitbucket-pipelines-configuration-reference/