# GitLab
GitLab is a web-based [[DevSecOps]] platform providing [[Git]] repository hosting, CI/CD, issue tracking, and the complete software development lifecycle in a single application. Founded in 2011, it offers both cloud-hosted (gitlab.com) and self-hosted options.
GitLab differentiates itself by providing an all-in-one DevOps platform rather than requiring integrations with separate tools.
## Key Features
- **Repositories**: Git hosting with merge requests
- **CI/CD Pipelines**: Built-in continuous integration/deployment
- **Issue Boards**: Kanban-style project management
- **Container Registry**: Docker image hosting
- **Package Registry**: npm, Maven, PyPI, etc.
- **Security Scanning**: SAST, DAST, dependency scanning
- **Wiki**: Built-in documentation
- **Self-hosting**: Community Edition is free and open source
## Editions
- Free
- Premium
- Ultimate
- Community (self-hosted)
## CI/CD (Continuous Integration/Continuous Deployment)
GitLab CI/CD automates building, testing, and deploying code. Pipelines are defined in [[Yet Another Markup Language (YAML)|YAML]] files (`.gitlab-ci.yml`) at the repository root.
**Key concepts:**
- **Pipeline**: A collection of jobs organized in stages
- **Stage**: A phase (build, test, deploy) where jobs run in parallel
- **Job**: A task that runs scripts in a runner environment
- **Runner**: An agent that executes jobs (shared or self-hosted)
- **Artifacts**: Files passed between jobs/stages
## CI/CD Pipeline Example
```yaml
# .gitlab-ci.yml
stages:
- build
- test
- deploy
build:
stage: build
script:
- npm install
- npm run build
artifacts:
paths:
- dist/
test:
stage: test
script:
- npm test
deploy:
stage: deploy
script:
- ./deploy.sh
only:
- main
environment: production
```
## References
- https://gitlab.com
- https://docs.gitlab.com
## Related
- [[Git]]
- [[GitHub]]
- [[GitLab CLI (glab)]]
- [[DevOps]]
- [[DevSecOps]]
- [[Yet Another Markup Language (YAML)]]