Challenge - 5 Problems
GitLab CI Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this GitLab CI pipeline status command?
You run the command
gitlab-runner status on a machine where GitLab Runner is installed and registered. What output do you expect if the runner is active and connected?Git
gitlab-runner status
Attempts:
2 left
💡 Hint
Think about what the status command shows when the runner is working.
✗ Incorrect
The
gitlab-runner status command shows the runner's platform and whether it is running or stopped. If active, it says 'GitLab Runner: running'.❓ Configuration
intermediate2:00remaining
Which .gitlab-ci.yml snippet correctly defines a job that runs only on the master branch?
You want a job named
deploy to run only when commits are pushed to the master branch. Which snippet achieves this?Attempts:
2 left
💡 Hint
Look for the keyword that specifies branches to include.
✗ Incorrect
The
only keyword restricts the job to run only on specified branches. Here, only: - master means the job runs only on the master branch.🔀 Workflow
advanced2:00remaining
What is the correct order of stages in this GitLab CI pipeline configuration?
Given this snippet, what is the order in which jobs run?
stages: - build - test - deploy build_job: stage: build script: echo Building test_job: stage: test script: echo Testing deploy_job: stage: deploy script: echo Deploying
Attempts:
2 left
💡 Hint
Jobs run in the order of stages defined at the top.
✗ Incorrect
Stages define the order: build first, then test, then deploy. Jobs in the same stage run in parallel.
❓ Troubleshoot
advanced2:00remaining
Why does this GitLab CI job fail with 'script not found' error?
This job fails with an error saying the script is not found:
The
job1:
script:
- ./deploy.shThe
deploy.sh file exists in the repository root. What is the most likely cause?Attempts:
2 left
💡 Hint
Check file permissions for scripts in CI jobs.
✗ Incorrect
If the script file lacks execute permission, the runner cannot run it, causing a 'script not found' error.
✅ Best Practice
expert2:00remaining
Which GitLab CI configuration snippet correctly caches dependencies to speed up pipeline runs?
You want to cache the
node_modules folder between pipeline runs to avoid reinstalling packages every time. Which snippet correctly configures caching?Attempts:
2 left
💡 Hint
Caching often requires a key to identify cache versions.
✗ Incorrect
Defining a cache key ensures the cache is stored and restored properly. Without a key, caching may not work as expected.