GitLab
GitLab Pipeline Syntax
Variables
Stages
Jobs
job_name:
stage: stage_name
script:
- command1
- command2
when: manual
dependencies:
- job1
- job2
environment:
name: production
url: https://example.com
only:
- master
- tags
except:
- schedules
Steps
step_name:
script:
- command1
- command2
when: manual
dependencies:
- job1
- job2
environment:
name: production
url: https://example.com
only:
- master
- tags
except:
- schedules
Artifacts
Cache
Trigger
Parallel
Services
Dependencies
Includes
Resources
Environments
environment_name:
url: https://example.com
on_stop: stop_environment_name
auto_stop_in: 1 hour
only:
- tags
except:
- schedules
Deployments
deployment_name:
environment:
name: environment_name
url: https://example.com
script:
- command1
- command2
when: manual
Reviews
review:
stage: review
environment:
name: review/$CI_COMMIT_REF_NAME
script:
- command1
- command2
only:
- branches
except:
- master
Pages
Security
Secrets
Deploy Tokens
deploy:
script:
- command1
- command2
environment:
url: https://example.com
name: production
only:
- tags
except:
- schedules
variables:
GIT_STRATEGY: fetch
when: manual
needs: []
Dependency Proxy
GitLab Ecosystem
The GitLab ecosystem consists of several building blocks that work together to provide a comprehensive DevOps platform. These building blocks enable teams to manage their source code, automate CI/CD pipelines, track issues and projects, secure their applications, and more. Here are the key components of the GitLab ecosystem:
- GitLab Repository: At the core of GitLab is the Git repository, where teams store and version control their source code. GitLab provides a web-based interface for managing repositories, including features like branch management, code review, and collaboration.
- Continuous Integration/Continuous Deployment (CI/CD): GitLab's CI/CD pipelines allow teams to automate the building, testing, and deployment of their applications. GitLab CI/CD provides a configuration file (.gitlab-ci.yml) that defines the stages, jobs, and actions to be executed. It supports parallel testing, deployment to various environments, and integration with other tools.
- Issue Tracking and Project Management: GitLab provides built-in issue tracking and project management capabilities. Teams can create issues, assign tasks, track progress, and manage project milestones. This integrated approach helps streamline development workflows and facilitates collaboration among team members.
- GitLab Runners: GitLab Runners are agents that execute jobs defined in CI/CD pipelines. They can be deployed on different operating systems and environments, allowing teams to run tests, build artifacts, and deploy applications to various platforms. GitLab Runners can be self-managed or used with GitLab's shared runners.
- GitLab Pages: GitLab Pages enables teams to publish static websites directly from their repositories. It simplifies the process of hosting documentation, project websites, or any other static content. GitLab Pages can be configured to automatically update based on repository changes.
- GitLab Container Registry: GitLab Container Registry provides a built-in Docker container registry for storing and managing container images. It allows teams to push, pull, and share container images within their organization securely. Integration with GitLab CI/CD enables seamless deployment of containerized applications.
- GitLab Security: GitLab offers a range of security features to help teams identify and address vulnerabilities in their code and infrastructure. This includes built-in static application security testing (SAST), dependency scanning, container scanning, and more. GitLab also integrates with external security tools and provides security dashboards for tracking and managing security vulnerabilities.
- GitLab Integrations: GitLab integrates with numerous tools and services, enabling teams to connect their workflows seamlessly. It integrates with popular issue trackers, chat tools, monitoring systems, and cloud platforms. This allows teams to leverage their existing toolchain while benefiting from GitLab's centralized platform.