Schmooky
← Back to Projects

CI Template Library

Reusable GitLab CI components that reduce duplication across repositories and standardize build pipelines.
active
DevOps GitLab CI/CD Templates
Year
2024
Status
active
Tech Stack
4 technologies

CI Template Library

A comprehensive collection of reusable GitLab CI/CD templates that eliminated code duplication across 50+ game development repositories.

Problem

Our team was managing dozens of game projects, each with similar but slightly different CI/CD configurations. This led to:

  • Maintenance nightmare: Updates required changes across multiple repositories
  • Inconsistent builds: Different projects used different Node.js versions, linting rules, and deployment strategies
  • Developer friction: New projects required copying and modifying existing CI configurations

Solution

I designed and implemented a modular CI template system using GitLab's include functionality:

Template Structure

# templates/base.yml
.base_job:
  image: node:18-alpine
  before_script:
    - npm ci --cache .npm --prefer-offline
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    paths:
      - .npm/

# templates/test.yml
include:
  - local: '/templates/base.yml'

test:
  extends: .base_job
  stage: test
  script:
    - npm run test:coverage
  coverage: '/Lines\s*:\s*(\d+\.\d+)%/'

Project Integration

Projects can now include only the templates they need:

# Project's .gitlab-ci.yml
include:
  - project: 'platform/ci-templates'
    ref: v2.1.0
    file:
      - '/templates/test.yml'
      - '/templates/build.yml'
      - '/templates/deploy.yml'

stages:
  - test
  - build
  - deploy

Impact

  • 90% reduction in CI configuration duplication
  • Zero-downtime updates: Template changes propagate automatically
  • Faster onboarding: New projects get CI in 5 minutes vs 2 hours
  • Standardized quality: All projects use the same linting, testing, and security scanning

Technical Details

The system uses GitLab's remote include feature with semantic versioning. Each template is thoroughly tested in a dedicated test project before release.

Key Features

  • Semantic versioning for backward compatibility
  • Parameterized templates for customization
  • Comprehensive documentation with examples
  • Automated testing of template changes

This project demonstrates how thoughtful abstraction can dramatically improve developer experience while maintaining flexibility.

← Back to All Projects