Understanding .gitlab-ci.yml for CI/CD Pipelines

 Day 31 Anatomy of .gitlab-ci.yml : Today let us understand what actually sits inside a .gitlab-ci.yml file, in very simple language. This one file tells GitLab how to run your CI/CD pipeline – what to run, in which order, and under what conditions. What is .gitlab-ci.yml? It is a YAML file kept in the root of your repo. GitLab reads this file on every push/merge and creates the pipeline from it. Inside this file, we define stages, jobs, scripts, and many other options. Think of it like a timetable for your code: which period is build, which is test, which is deploy, and what to do in each period. Main building blocks inside .gitlab-ci.yml stages : This defines the order of your pipeline steps, for example: build, test, deploy. Jobs in the same stage run in parallel; next stage starts only after previous stage passes. jobs : Each top‑level name (that is not a keyword like stages) is treated as a job. A job tells “what to do” in that stage (like run tests, build artifact, deploy to server). script : This is the actual command list that will run inside the job, for example npm install, npm test, sfdx force:source:deploy. #GitLab #GitLabCI #DevOps #CICD #SalesforceDevOps

To view or add a comment, sign in

Explore content categories