Day 81: First Pipeline & GitLab Runners


Today was an exciting step forward in my CI/CD journey with GitLab!
π What I did today:
β Learned about GitLab Runners (shared vs. specific)
β Configured a runner for my project
β Wrote my first GitLab CI/CD pipeline (
.gitlab-ci.yml
)β Successfully ran jobs using the runner π
π Key Takeaways
GitLab Runners are the backbone of CI/CD in GitLab. They pick up jobs defined in the pipeline and execute them.
There are two main types:
Shared Runners: Available for all projects.
Specific Runners: Tied to a particular project or group.
The
.gitlab-ci.yml
file is where the pipeline magic happens β defining stages like build, test, and deploy.Pipeline code:
stages: - build - test build_job: stage: build script: - echo "This is a build stage from gitlab for building a docker image command is <docker build -t .>" test_job: stage: test script: - echo "This is a test stage from gitlab for testing a docker images" - mkdir -p logs - echo "this is logs from test job" test_deploy_task: stage: test script: - echo "this job is running in parallel"
π Why this matters
Understanding runners and pipelines is crucial because itβs the foundation of automation in GitLab CI/CD. From here, Iβll move toward building more advanced pipelines with testing, artifact handling, and deployment.
π₯ Up next: Setting up advanced stages in my GitLab pipelines!
Subscribe to my newsletter
Read articles from Shaharyar Shakir directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
