Gitlab CI Flashcards
What is GitLab CI/CD?
GitLab CI/CD is a continuous integration and continuous deployment (CI/CD) tool integrated into GitLab. It allows you to automate the build, test, and deployment processes of your applications. GitLab CI/CD uses pipelines defined in a .gitlab-ci.yml file to manage these processes.
How do you set up a GitLab CI/CD pipeline?
To set up a GitLab CI/CD pipeline:
Create a .gitlab-ci.yml file: Define the stages, jobs, and scripts for your pipeline.
Push to GitLab: Commit and push the .gitlab-ci.yml file to your repository.
Run Pipeline: GitLab automatically detects the file and runs the pipeline based on the defined stages and jobs.
What are GitLab runners?
GitLab runners are agents that execute the jobs defined in your CI/CD pipeline. Runners can be shared (provided by GitLab) or specific (self-hosted). They can run on various environments, including Docker, virtual machines, and bare-metal servers.
How do you secure your GitLab CI/CD pipeline?
To secure your GitLab CI/CD pipeline:
Use Protected Variables: Store sensitive information in protected variables.
Restrict Runner Access: Limit runner access to specific projects or groups.
Use Secure Images: Use trusted and secure Docker images for your jobs.
Enable Two-Factor Authentication (2FA): Require 2FA for GitLab accounts.
What are some common use cases for GitLab CI/CD?
Common use cases include:
Automated Testing: Run tests automatically on code changes.
Continuous Deployment: Deploy applications to production environments.
Code Quality Checks: Perform static code analysis and linting.
Infrastructure as Code: Manage infrastructure changes using tools like Terraform.