GitLab CI/CD Components Implementation Guide
Complete guide for implementing the enterprise GitLab CI/CD components across the LLM Platform ecosystem.
π Quick Startβ
Basic Implementationβ
# .gitlab-ci.yml
include:
# Security scanning
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/security/security-scan@0.1.0
inputs:
security_level: "cui"
compliance_frameworks: ["NIST", "FISMA"]
# Multi-platform build
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/build/multi-platform-build@0.1.0
inputs:
build_environment: "production"
# Comprehensive testing
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/testing/comprehensive-testing@0.1.0
inputs:
coverage_threshold: 85
# Production deployment
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/deployment/government-production@0.1.0
inputs:
security_level: "cui"
tenant_isolation: true
π¦ Available Componentsβ
1. Security Scanning Componentβ
Path: components/ci-cd/security/security-scan@0.1.0
Key Features:
- SAST, DAST, container scanning, secret detection
- Government compliance verification (NIST, FISMA, SOC2, HIPAA)
- Executive security reporting
Usage:
security-scan:
include:
- component: .../security-scan@0.1.0
inputs:
security_level: "cui" # public|cui|secret
sast_enabled: true
dast_enabled: true
secret_detection_enabled: true
container_scan_enabled: true
compliance_frameworks: ["NIST", "FISMA"]
fail_on_high: true
target_url: "https://staging.example.com"
2. Multi-Platform Build Componentβ
Path: components/ci-cd/build/multi-platform-build@0.1.0
Key Features:
- Drupal modules, Node.js services, Docker images, Helm charts
- Multi-architecture builds (AMD64/ARM64)
- Build optimization and caching
Usage:
build:
include:
- component: .../multi-platform-build@0.1.0
inputs:
php_version: "8.3"
node_version: "20"
drupal_version: "10"
build_environment: "production"
optimize_build: true
multi_arch_build: true
security_scan_enabled: true
parallel_builds: 6
3. Comprehensive Testing Componentβ
Path: components/ci-cd/testing/comprehensive-testing@0.1.0
Key Features:
- Unit, integration, E2E, and performance testing
- Coverage aggregation across platforms
- Quality scoring
Usage:
test:
include:
- component: .../comprehensive-testing@0.1.0
inputs:
coverage_threshold: 85
performance_threshold: 2000
browser_tests_enabled: true
api_tests_enabled: true
load_tests_enabled: true
parallel_jobs: 8
4. Government Production Deploymentβ
Path: components/ci-cd/deployment/government-production@0.1.0
Key Features:
- Government compliance deployment
- Multi-tenant architecture
- Vault integration
- Ollama cluster deployment
Usage:
deploy:
include:
- component: .../government-production@0.1.0
inputs:
environment: "production"
security_level: "cui"
tenant_isolation: true
stig_compliance: true
vault_enabled: true
monitoring_enabled: true
ollama_cluster_enabled: true
ποΈ Implementation Examplesβ
Drupal Module Pipelineβ
# _DrupalSource/Modules/your-module/.gitlab-ci.yml
stages:
- security-scan
- build
- test
- deploy
variables:
MODULE_NAME: "your_module"
SECURITY_LEVEL: "cui"
# Use components
include:
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/security/security-scan@0.1.0
inputs:
security_level: $SECURITY_LEVEL
compliance_frameworks: ["NIST", "FISMA"]
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/build/multi-platform-build@0.1.0
inputs:
php_version: "8.3"
drupal_version: "10"
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/testing/comprehensive-testing@0.1.0
inputs:
coverage_threshold: 90
browser_tests_enabled: true
# Module-specific jobs
module-specific-tests:
stage: test
script:
- vendor/bin/phpunit tests/src/Integration/
Node.js Service Pipelineβ
# _CommonNPM/your-service/.gitlab-ci.yml
stages:
- security-scan
- build
- test
- containerize
- deploy
variables:
SERVICE_NAME: "your-service"
NODE_VERSION: "20"
include:
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/security/security-scan@0.1.0
inputs:
security_level: "cui"
container_scan_enabled: true
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/build/multi-platform-build@0.1.0
inputs:
node_version: $NODE_VERSION
multi_arch_build: true
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/testing/comprehensive-testing@0.1.0
inputs:
coverage_threshold: 85
api_tests_enabled: true
performance_threshold: 1500
# Service-specific deployment
deploy-service:
stage: deploy
include:
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/deployment/government-production@0.1.0
inputs:
environment: "production"
ollama_cluster_enabled: false # Service doesn't need Ollama
Complete Platform Pipelineβ
# llm-platform/.gitlab-ci.yml
stages:
- security-scan
- build
- test
- integration
- deploy
- verify
variables:
PLATFORM_NAME: "llm-platform"
SECURITY_LEVEL: "cui"
# Platform-wide security scan
platform-security:
include:
- component: .../security-scan@0.1.0
inputs:
security_level: $SECURITY_LEVEL
compliance_frameworks: ["NIST", "FISMA", "SOC2", "HIPAA"]
fail_on_high: true
# Build all components
build-all:
include:
- component: .../multi-platform-build@0.1.0
inputs:
php_version: "8.3"
node_version: "20"
multi_arch_build: true
parallel_builds: 8
# Test everything
test-all:
include:
- component: .../comprehensive-testing@0.1.0
inputs:
coverage_threshold: 85
browser_tests_enabled: true
api_tests_enabled: true
load_tests_enabled: true
# Deploy to production
deploy-prod:
include:
- component: .../government-production@0.1.0
inputs:
environment: "production"
security_level: $SECURITY_LEVEL
tenant_isolation: true
stig_compliance: true
vault_enabled: true
monitoring_enabled: true
ollama_cluster_enabled: true
backup_enabled: true
π§ Configuration Optionsβ
Security Levelsβ
Level | Description | Use Case |
---|---|---|
public | Basic security controls | Public-facing demo sites |
cui | Controlled Unclassified Information | Government data processing |
secret | Maximum security controls | Classified information |
Compliance Frameworksβ
- NIST: NIST 800-53 security controls
- FISMA: Federal Information Security Management Act
- SOC2: Service Organization Control 2
- HIPAA: Health Insurance Portability and Accountability Act
- STIG: Security Technical Implementation Guide
Build Environmentsβ
- development: Fast builds, debugging enabled
- staging: Production-like, with test data
- production: Optimized, security hardened
π Output Artifactsβ
Security Componentβ
security-reports/
- All scan resultsfinal-reports/security-aggregated-report.json
- Summaryfinal-reports/executive-summary.json
- Executive dashboard
Build Componentβ
build-artifacts/
- Compiled codehelm-packages/
- Helm chartsdocker-build-metadata-*.json
- Image metadata
Testing Componentβ
coverage/
- Coverage reportstest-results/
- Test resultsperformance-summary.json
- Performance metrics
Deployment Componentβ
deployment-summary.json
- Deployment status- Network policies and configurations
- Health check results
π¦ Quality Gatesβ
Components automatically enforce:
-
Security Gates
- No critical vulnerabilities
- No exposed secrets
- Compliance validation passed
-
Quality Gates
- Code coverage meets threshold
- All tests passing
- Performance within limits
-
Deployment Gates
- Health checks passing
- Security policies applied
- Monitoring active
π Troubleshootingβ
Common Issuesβ
Component not found:
# Ensure correct path and version
include:
- component: gitlab.bluefly.io/llm/bfcicomponents/components/ci-cd/security/security-scan@0.1.0
Security scan failures:
# Adjust security level for development
inputs:
security_level: "public"
fail_on_high: false
Build timeouts:
# Reduce parallel builds
inputs:
parallel_builds: 2
build_timeout: 60
π― Best Practicesβ
- Start with security - Always run security scans first
- Use caching - Enable cache for faster builds
- Parallel execution - Use parallel jobs where possible
- Progressive deployment - Deploy to staging before production
- Monitor everything - Enable monitoring in all environments
π Performance Tipsβ
-
Cache dependencies:
cache_enabled: true
-
Optimize builds:
optimize_build: true
parallel_builds: 6 -
Selective testing:
browser_tests_enabled: false # If not needed
load_tests_enabled: false # For faster feedback
π Integration with Existing CI/CDβ
Gradual Migrationβ
-
Start with one component:
include:
- component: .../security-scan@0.1.0 -
Keep existing jobs:
my-custom-job:
stage: test
script:
- echo "Existing job continues to work" -
Gradually replace with components
Hybrid Approachβ
# Use components for standard tasks
include:
- component: .../security-scan@0.1.0
- component: .../build/multi-platform-build@0.1.0
# Custom jobs for specific needs
custom-integration-test:
stage: test
script:
- ./run-custom-tests.sh
π Additional Resourcesβ
Ready to implement enterprise-grade CI/CD across your LLM Platform projects! π