- Get Started
- Functionality
- Learning
- Extension
- Dev Tooling
- APIs
- Releases
Changed on:
9 Nov 2026
| Stage | Runs on | Purpose |
| Build and test | Every push | Compile rules, run unit tests, assemble the module archive |
| Static checks | Every push | Workflow structure, lint and format |
| Deploy | `dev` merges; release branches (manual) | Configure and install the module |
| Post-deploy verification | After every deploy | Read back installed versions and fail on a mismatch |
| Tag | `main` merges | Name the release |
`deployment:` on a stage gives every step in the stage that environment's variables and serialises deploys to it. If you forget it, the variables arrive empty or as literal `$NAME` text, which `profile.sh` detects.`--skip-if-installed` avoids re-uploading a plugin version the account already has, while installing workflows with `--force` always reapplies them so the account cannot drift from the repository.`main`. If your controls require byte-for-byte promotion, publish the archive from the `main` build to an artifact store and have the release pipeline download it instead of rebuilding (see Verification and promotion).`logs/`, so a failed deploy can be diagnosed from the pipeline run alone.`condition: changesets: includePaths` can skip the Mystique steps when `frontend/` is untouched. Never skip a deploy-gating test this way.1flowchart LR
2 A[Build + unit test<br/>module] --> D
3 B[Workflow checks] --> D
4 C[Mystique lint + build] --> D
5 D{Merge queue} --> E[Deploy to dev]
6 E --> F[Post-deploy<br/>verification]
7 F --> G[Live e2e]
8 G --> H[Tag + release branch]
9 H --> I[Deploy to UAT<br/>manual]
10 I --> J[Deploy to prod<br/>manual]1definitions:
2 steps:
3 - step: &build-and-test-module
4 name: Build and test module
5 image: &jvm-build-image maven:3.9.16-eclipse-temurin-17-noble
6 caches:
7 - maven
8 size: 4x
9 script:
10 - cicd/prepare.sh
11 # The build identifier becomes the module version suffix (see Modules > Versioning).
12 - modules/acme-extensions/scripts/build-module.sh -v "${BITBUCKET_TAG:-$BITBUCKET_BUILD_NUMBER}"
13 artifacts:
14 paths:
15 - logs/**
16 - modules/acme-extensions/dist/**
17
18 - step: &workflow-checks
19 name: Workflow checks
20 image: node:22
21 script:
22 # Replace with your own structural checks: valid JSON, every rule referenced
23 # by a workflow is listed in module.json, no duplicate ruleset names, etc.
24 - node cicd/check-workflows.mjs modules/acme-extensions/resources/workflows
25
26 - step: &mystique-build
27 name: Mystique lint and build
28 image: node:22
29 caches:
30 - node
31 script:
32 - cd frontend/acme-mystique-plugin
33 - npm ci
34 - npm run lint
35 - npm test
36 - npm run build
37 artifacts:
38 - frontend/acme-mystique-plugin/dist/**
39
40 - step: &install
41 name: Install module
42 image: *jvm-build-image
43 script:
44 - cicd/prepare.sh
45 # Assigned here rather than in prepare.sh: a subprocess cannot export back to the step.
46 - FLUENT="$BITBUCKET_CLONE_DIR/fluent-cli.sh"
47 - export FLUENT_LOG_DIR="$BITBUCKET_CLONE_DIR/logs"
48 - export FLUENT_PROFILE=cicd
49 - cicd/profile.sh modules
50 # The archive comes from the build step's artifact; it is not rebuilt here.
51 - cd modules/acme-extensions/dist/*/
52 - $FLUENT module config . -p "$FLUENT_PROFILE" -r "$FLUENT_RETAILERS"
53 # Rules: skip if this exact version is already installed.
54 - $FLUENT module install . -p "$FLUENT_PROFILE" -r "$FLUENT_RETAILERS" --include rules --skip-if-installed --force
55 # Workflows: always reapplied, so the account matches the repository.
56 - $FLUENT module install . -p "$FLUENT_PROFILE" -r "$FLUENT_RETAILERS" --include workflows --force
57 artifacts:
58 paths:
59 - logs/**
60
61 - step: &post-deploy-verify
62 name: Post-deploy verification
63 image: *jvm-build-image
64 script:
65 - cicd/prepare.sh
66 - FLUENT="$BITBUCKET_CLONE_DIR/fluent-cli.sh"
67 - export FLUENT_LOG_DIR="$BITBUCKET_CLONE_DIR/logs"
68 - export FLUENT_PROFILE=cicd
69 - cicd/profile.sh modules
70 # Fail if the installed version is not the one this pipeline built (see Verification).
71 - cicd/verify-deploy.sh modules/acme-extensions/dist
72 artifacts:
73 paths:
74 - logs/**
75
76 - step: &deploy-mystique
77 name: Publish Mystique bundle
78 image: node:22
79 script:
80 - cicd/publish-mystique.sh frontend/acme-mystique-plugin/dist
81
82 - step: &git-tag
83 name: Tag for release
84 clone:
85 depth: 50
86 script:
87 - &git-tag-script |
88 : "${GIT_TAG:?GIT_TAG is required}"
89 if git ls-remote --tags origin | awk -v c="$BITBUCKET_COMMIT" '$1 == c { f=1 } END { exit !f }'; then
90 echo "Commit $BITBUCKET_COMMIT is already tagged, skipping"; exit 0
91 fi
92 if git ls-remote --exit-code --tags origin "refs/tags/$GIT_TAG" >/dev/null 2>&1; then
93 echo "Tag $GIT_TAG already exists"; exit 1
94 fi
95 git tag "$GIT_TAG" "$BITBUCKET_COMMIT"
96 git push origin "refs/tags/$GIT_TAG"
97
98 - step: &create-release-branch
99 name: Cut release branch
100 clone:
101 depth: 50
102 script:
103 - RELEASE_BRANCH="release/$BITBUCKET_TAG"
104 - |
105 if git ls-remote --exit-code --heads origin "$RELEASE_BRANCH" >/dev/null 2>&1; then
106 echo "$RELEASE_BRANCH already exists"
107 else
108 git push origin "$BITBUCKET_COMMIT:refs/heads/$RELEASE_BRANCH"
109 fi
110
111 stages:
112 - stage: &deploy
113 steps:
114 - step: *install
115 - step: *post-deploy-verify
116 - step: *deploy-mystique
117
118 - stage: &deploy-to-dev
119 name: Deploy to ACMEDEV
120 deployment: ACMEDEV
121 <<: *deploy
122
123 - stage: &deploy-to-uat
124 name: Deploy to ACMEUAT
125 deployment: ACMEUAT
126 trigger: manual
127 <<: *deploy
128
129 - stage: &deploy-to-prod
130 name: Deploy to ACMEPROD
131 deployment: ACMEPROD
132 trigger: manual
133 <<: *deploy
134
135pipelines:
136 default:
137 - &build-and-check
138 parallel:
139 - step: *build-and-test-module
140 - step: *workflow-checks
141 - step: *mystique-build
142
143 merge-queues:
144 merge-to-dev:
145 - *build-and-check
146 - stage: *deploy-to-dev
147 merge-to-main:
148 - *build-and-check
149
150 branches:
151 main:
152 - *build-and-check
153 - step:
154 <<: *git-tag
155 script:
156 - export GIT_TAG="${BITBUCKET_BUILD_NUMBER}"
157 - *git-tag-script
158
159 'release/**':
160 - *build-and-check
161 - stage: *deploy-to-uat
162 - stage: *deploy-to-prod
163
164 tags:
165 '**':
166 - step: *create-release-branch