0
0
Jenkinsdevops~10 mins

GitLab CI comparison in Jenkins - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - GitLab CI comparison
Write Jenkinsfile
Commit to Repo
Jenkins Polls or Webhook Trigger
Jenkins Master Schedules Job
Agent Executes Pipeline Steps
Job Status Reported
Developer Sees Results
Write .gitlab-ci.yml
Commit to Repo
GitLab Detects Commit
GitLab Runner Executes Jobs
Job Status Reported
Developer Sees Results
Shows the step-by-step flow of how Jenkins and GitLab CI pipelines are triggered and executed after code commits.
Execution Sample
Jenkins
pipeline {
  agent any
  stages {
    stage('Build') {
      steps { echo 'Building...' }
    }
  }
}
A simple Jenkins pipeline that runs a build stage printing 'Building...'
Process Table
StepActionTriggerResultNotes
1Write JenkinsfileManualJenkinsfile created in repoDefines pipeline steps
2Commit JenkinsfileDeveloper commitCode pushed to repoTriggers Jenkins polling or webhook
3Jenkins detects commitPolling/WebhookSchedules pipeline jobMaster assigns job to agent
4Agent runs 'Build' stageJob startPrints 'Building...'Executes pipeline steps
5Job completesJob endStatus reported to Jenkins UISuccess or failure shown
6Write .gitlab-ci.ymlManual.gitlab-ci.yml createdDefines GitLab CI jobs
7Commit .gitlab-ci.ymlDeveloper commitCode pushed to GitLab repoTriggers GitLab pipeline
8GitLab detects commitPush eventPipeline scheduledGitLab Runner picks job
9Runner executes jobJob startJob runs defined stepsOutputs logs in GitLab UI
10Job completesJob endStatus shown in GitLab UISuccess or failure visible
11ExitNo more stepsPipeline finishedEnd of process
💡 Pipeline finishes after all stages/jobs complete and status is reported
Status Tracker
VariableStartAfter Step 2After Step 4After Step 5After Step 7After Step 9Final
JenkinsfileNoneCreatedExistsExistsExistsExistsExists
.gitlab-ci.ymlNoneNoneNoneNoneCreatedExistsExists
Pipeline StatusNonePendingRunningSuccessPendingRunningSuccess
Key Moments - 3 Insights
Why does Jenkins need a separate agent to run jobs?
Jenkins master schedules jobs but agents do the actual work to keep master free for coordination, as shown in execution_table step 3 and 4.
How does GitLab CI detect when to start a pipeline?
GitLab CI automatically detects commits via push events to the repo, triggering pipelines without extra setup, as seen in execution_table step 8.
Can Jenkins and GitLab CI pipelines run on the same repository?
Yes, both can run independently if configured, but they use different config files and runners/agents, shown by separate steps for Jenkinsfile and .gitlab-ci.yml.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, at which step does Jenkins agent start running the build stage?
AStep 4
BStep 5
CStep 3
DStep 2
💡 Hint
Check the 'Action' and 'Result' columns for when the build stage runs.
According to the variable tracker, what is the pipeline status after step 5?
APending
BRunning
CSuccess
DNone
💡 Hint
Look at the 'Pipeline Status' row under 'After Step 5' column.
If the .gitlab-ci.yml file is not committed, what happens to the GitLab pipeline?
APipeline runs with default settings
BPipeline is not triggered
CPipeline runs but fails immediately
DPipeline triggers Jenkins instead
💡 Hint
Refer to execution_table steps 6 and 7 about .gitlab-ci.yml creation and commit.
Concept Snapshot
GitLab CI and Jenkins both automate code testing and deployment.
Jenkins uses a Jenkinsfile and agents to run pipelines.
GitLab CI uses .gitlab-ci.yml and runners triggered by repo pushes.
Both report job status to developers.
Jenkins requires separate agents; GitLab CI integrates runners.
Choose based on your project needs and environment.
Full Transcript
This visual execution compares Jenkins and GitLab CI pipelines. Jenkins requires writing a Jenkinsfile, committing it, then Jenkins detects the commit via polling or webhook. The master schedules the job, and an agent runs the pipeline steps like 'Build'. The job status is reported back to Jenkins UI. GitLab CI uses a .gitlab-ci.yml file committed to the repo. GitLab detects the commit automatically and schedules the pipeline. GitLab runners execute the jobs and show status in GitLab UI. Variables like pipeline status change from pending to running to success as jobs progress. Key points include Jenkins needing agents to run jobs, GitLab CI triggering pipelines automatically on push, and both systems being able to run on the same repo independently. The quiz checks understanding of when Jenkins agents run, pipeline status changes, and GitLab pipeline triggers. This helps beginners see the step-by-step flow and differences between Jenkins and GitLab CI.