The copy of this guide is also published in: GitLab+Pipelines+for+Customer+Projects
First, ensure that you have a .gitlab-ci.yml file in the root directory of your project.
Generate the file from Studio by right clicking on the root folder > Pricefx > Create '.gitlab-ci.yml'. This will generate a file that refers to the common template from this repo which contains the common definition of the stages.
include:
- project: "public-tools/build-templates"
ref: master
file: "/test+analyze+deploy/.gitlab-ci.yml"This template 'test+analyze+deploy' provides:
- unit-tests = Maven-based unit testing with JUnit reports
- pfxprobe = Code quality analysis with configurable quality gate
- deploy = Automatic deployment using pfxpackage tool
Github actions configuration is quite different from gitlab.
Available within this repo at [./.github/workflows/] you will find:
- ci.yaml - This file is the primary place for you to manage your CI config
- template.yaml - This contains the complex workflow setup which the main CI file references
- You do not need to modify this file, but you must copy it.
To use this sample, copy both files into your project, into the same filepath .github/workflows
The template supports these configuration variables:
| Variable | Default | Description |
|---|---|---|
QUALITY_GATE |
"critical" |
Severity threshold for code quality failures. Options: info, minor, major, critical |
COMPONENT_FOLDER |
".PfxComponents" |
Folder containing reusable Pricefx packages |
For each partition you want to deploy to, add a job block like:
deploy-dev:
extends: .deploy
when: manual
only:
- dev
variables:
PARTITION: partition-dev
URL: https://dev.pricefx.euRequired Setup:
- Name the job to match your partition (e.g.,
deploy-qa,deploy-prod) - Set
PARTITIONandURLvariables for your target environment - Configure branch triggers using
onlysection - Set PFX_USER and PFX_PASS as masked CI variables in GitLab project settings:
- Navigate to Settings → CI/CD → Variables
- Set
PFX_USERto 'pfx.deploy' - Set
PFX_PASSto a strong password (16+ chars, 1 digit, 1 capital) - Create 'pfx.deploy' user with admin privileges in target partitions
Deployment Triggers:
when: manual- Job created but requires manual trigger (recommended for DEV)when: always- Auto-triggers on branch update (recommended for QA/PROD)
Complete CI configuration with unit tests, quality gate, and three-tier deployment:
include:
- project: "public-tools/build-templates"
ref: master
file: "/test+analyze+deploy/.gitlab-ci.yml"
variables:
QUALITY_GATE: "major" # Fail pipeline on major+ issues
COMPONENT_FOLDER: ".PfxComponents"
deploy-dev:
extends: .deploy
when: manual
only:
- dev
variables:
PARTITION: partition-dev
URL: https://dev.pricefx.eu
deploy-qa:
extends: .deploy
when: always
only:
- qa
variables:
PARTITION: partition-qa
URL: https://qa.pricefx.eu
deploy-prod:
extends: .deploy
when: always
only:
- master
variables:
PARTITION: partition
URL: https://prod.pricefx.euPipeline Behavior:
- Runs on merge requests, protected branches, or branches matching
dev|develop|qa|master - Deploys project root contents plus all subdirectories in
COMPONENT_FOLDER - Quality gate failures block pipeline when threshold is exceeded
- Uploads the full
.pfxprobe/artifact directory (codeclimate.json, SARIF, quality markdown)