Assess your understanding of core GitLab CI/CD concepts, pipelines, job configuration, and environment variables. This quiz is designed to help beginners strengthen their knowledge of continuous integration and continuous deployment workflows.
Which file format is primarily used to define the configuration for pipelines in GitLab CI/CD?
Explanation: YAML is used for writing configuration files due to its simplicity and human readability. JSON and XML are also markup formats but are not used for defining pipelines in this context. CSV is a data format for tabular data, not configuration.
What typically triggers a pipeline to run in a Git-based CI/CD system when no manual interaction is required?
Explanation: Pushing code to a repository automatically triggers the pipeline process in CI/CD by detecting new commits. Manually clicking on the dashboard is not automatic, and actions like restarting your computer or changing a password are unrelated to pipelines.
In a typical pipeline configuration, what is a 'job'?
Explanation: A job is a defined task or set of commands executed as part of a pipeline. It is not a group of users or an email notification, and has nothing to do with storage locations. Its purpose is to perform individual steps such as building or testing code.
What is the primary purpose of using 'stages' in a pipeline configuration file?
Explanation: Stages divide the pipeline into logical sections and enforce execution order, such as build, test, and deploy. They don't increase server speed, store credentials, or serve as access control mechanisms.
Why are environment variables commonly used in CI/CD pipelines?
Explanation: Environment variables allow storage of confidential or environment-specific data securely, like API keys or tokens. They are not meant for backing up documents, managing browser history, or tracking password expiration dates, which are different use cases.
What is commonly used to visualize the flow and status of jobs across different stages in a CI/CD pipeline?
Explanation: A pipeline graph visually depicts job progression and stage completion, making it easy to understand the CI/CD workflow. Calendars manage dates, chat windows are for messaging, and search bars locate information, all unrelated to pipeline visualization.
What is an artifact in the context of CI/CD pipelines?
Explanation: Artifacts are files or result outputs generated by jobs and preserved for later stages or downloads, such as compiled binaries. A user's profile photo or an error message isn't considered an artifact, nor is a programming language.
Jobs within the same stage of a pipeline configuration will typically run in which manner by default?
Explanation: By default, jobs within the same stage are executed in parallel to optimize speed. Running one after another refers to sequential execution, which is not standard within a stage. Triggering jobs only after approval or monthly is unrelated to default job execution behavior.
Which keyword is used in a pipeline job configuration to ensure a job runs only under specific conditions, such as only when certain files change?
Explanation: The 'only' keyword is used to set conditions for job execution based on branches, tags, or file changes. 'Script' specifies which commands are run, 'image' defines the container image, and 'path' is not a recognized keyword for conditional execution.
What is a 'shared runner' in a CI/CD system?
Explanation: A shared runner is a build agent or machine used for executing jobs in various projects, reducing the need for project-specific resources. It is not a workstation, nor is it a configuration file or hardware arrangement like dual-monitors.