GlassOps on GitLab CI
.gitlab-ci.yml runs the pr pipeline on merge requests and the deploy pipeline on a push to the default branch. 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 GitLab's documentation of the predefined variables. It has not been run on a real GitLab runner yet, so treat the first run as a proof.
Set up
- Add the variables
glassops.yamlnames with$VAR(for exampleSF_JWT_KEY) as masked CI/CD variables. - Protect the default branch. Add
GLASSOPS_PERMIT_KEYas a CI/CD variable that is protected, masked and limited to theproductionenvironment. Generate the value withopenssl rand -base64 32. Merge request pipelines never see it.
How it behaves
GIT_DEPTH: "0"fetches the full history, so change sets between commits are complete.- The image sets
entrypoint: [""], because GitLab needs a shell to run script lines. - Merge request pipelines report
Eventaspull_request, with the merge request IID and the target branch. Other pipeline sources (schedule, web, api) are passed through as they are. - Outputs are appended to
.glassops/outputs.env, which the job publishes withartifacts:reports:dotenv. The run summary goes to.glassops/summary.md. SetGLASSOPS_OUTPUT_FILEorGLASSOPS_SUMMARY_FILEto move them. - Approval evidence (labels, environment approvals) is not read from GitLab. On this CI, separation of duties is enforce or off per tier.
- A job token usually cannot push, so moving the
glassops/deployed/*tag only warns until you provide a push credential.