GlassOps on Bitbucket Pipelines
bitbucket-pipelines.yml runs the pr pipeline on pull requests and the deploy pipeline on a push to main. glassops.yaml is the same Salesforce config as examples/consumer. Copy both into a Salesforce DX project, or run glassops init there.
This layer is written from Atlassian's documentation of the predefined variables. It has not been run on a real Bitbucket runner yet, so treat the first run as a proof.
Set up
- Enable Pipelines for the repository.
- Add the variables
glassops.yamlnames with$VAR(for exampleSF_JWT_KEY) as secured repository variables. - Create a
productiondeployment environment, restrict it tomain, and addGLASSOPS_PERMIT_KEYas a secured variable of that environment only. Generate the value withopenssl rand -base64 32. The pr pipeline never sees it.
How it behaves
- The clone is full depth, so change sets between commits are complete.
- Pull request pipelines report
Eventaspull_request, with the pull request number and the destination branch. - Bitbucket exposes no user name, so the actor is the UUID of whoever started the build.
- Outputs are appended to
.glassops/outputs.envand the run summary to.glassops/summary.md. Both are collected as artifacts. SetGLASSOPS_OUTPUT_FILEorGLASSOPS_SUMMARY_FILEto move them. - Approval evidence (labels, environment approvals) is not read from Bitbucket. On this CI, separation of duties is enforce or off per tier.