Contributing to gitlab-ci-templates¶
Thanks for your interest in contributing!
Reporting Issues¶
- Check existing issues first
- Create a new issue with:
- Your GitLab version and runner executor type
- The
.gitlab-ci.ymlconfig you used - Relevant CI job logs (redact secrets)
Submitting Changes¶
- Fork the repository
- Create a feature branch:
- Make your changes following the style guide below
- Test locally:
- Commit with conventional commits:
- Open a Pull Request
Style Guide¶
YAML¶
- 2-space indentation, lines under 120 chars
- Quote strings with special characters
Shell¶
#!/usr/bin/env bashshebangset -eo pipefail(useset -euo pipefailonly in scripts designed for it)- Quote all variable references:
"${VAR}" - Use
$()instead of backticks
Dockerfile¶
- Pin base image versions
- Multi-stage builds when appropriate
- Order layers by change frequency
- Support
DOCKER_MIRROR_PREFIXfor base images
Two-Track System¶
All template files exist in two versions:
- *.stable.* -- production-ready, breaking changes require version bump
- *.latest.* -- experimental, may change without notice
Always update both when modifying core logic.
Project Structure¶
templates/ # Entry points for downstream projects
jobs-templates/ # Reusable job definitions per stage
utils/ # Rule snippets, before/after scripts
vars/ # Default variable configurations
scripts/ # Shell scripts executed by CI jobs
dockerfile/templates/ # Application Dockerfile templates
images/ # CI builder image Dockerfiles
examples/ # Ready-to-use .gitlab-ci.yml examples
docs/ # Documentation
hack/ # Development and testing scripts
License¶
By contributing, you agree your contributions will be licensed under the MIT License.