5.5 KiB
5.5 KiB
CI/CD Pilot Projects
Date: 2025-01-27 Purpose: Guide for selecting and migrating pilot projects to unified CI/CD Status: Implementation Guide
Overview
This document identifies candidate projects for CI/CD pilot migration and provides step-by-step migration instructions.
Pilot Project Selection Criteria
Ideal Candidates
- Active projects with regular commits
- TypeScript/Node.js projects (matches template)
- Well-tested projects (have test suites)
- Medium complexity (not too simple, not too complex)
- Team availability for feedback
Recommended Pilot Projects
High Priority (Start Here)
-
workspace-shared (New project)
- Why: New project, clean slate
- Complexity: Low
- Risk: Low
- Benefits: Validates template for monorepo
-
dbis_core (Active project)
- Why: Core project, high visibility
- Complexity: Medium
- Risk: Medium
- Benefits: Validates for large TypeScript project
-
the_order (Active monorepo)
- Why: Monorepo structure, good test case
- Complexity: High
- Risk: Medium
- Benefits: Validates monorepo CI/CD patterns
Medium Priority
-
Sankofa/api (Backend service)
- Why: API service, common pattern
- Complexity: Medium
- Risk: Low
-
no_five (DeFi project)
- Why: Different domain, validates template flexibility
- Complexity: Medium
- Risk: Medium
Migration Steps
Step 1: Prepare Project
-
Review current CI/CD (if exists)
- Document current workflow
- Identify project-specific requirements
- Note any custom steps
-
Update project structure (if needed)
- Ensure package.json has required scripts
- Verify test setup
- Check build configuration
Step 2: Create Workflow File
- Copy template:
.github/workflows/ci-pilot-template.yml - Rename:
ci-<project-name>.yml - Update paths: Replace
project-namewith actual project path - Customize: Add project-specific steps if needed
Step 3: Test Locally
-
Install act (GitHub Actions local runner):
brew install act # macOS # or curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash -
Test workflow:
act -W .github/workflows/ci-<project-name>.yml
Step 4: Deploy
- Commit workflow file
- Push to branch
- Monitor first run
- Fix any issues
- Merge to main
Step 5: Gather Feedback
- Monitor for 1-2 weeks
- Collect feedback from team
- Document issues and improvements
- Refine template
Project-Specific Examples
Example 1: workspace-shared
Workflow: .github/workflows/ci-workspace-shared.yml
name: CI - Workspace Shared
on:
push:
branches: [main, develop]
paths:
- 'workspace-shared/**'
pull_request:
branches: [main, develop]
paths:
- 'workspace-shared/**'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./workspace-shared
# ... rest of template
Example 2: dbis_core
Workflow: .github/workflows/ci-dbis-core.yml
name: CI - DBIS Core
on:
push:
branches: [main, develop]
paths:
- 'dbis_core/**'
pull_request:
branches: [main, develop]
paths:
- 'dbis_core/**'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dbis_core
# ... rest of template
Migration Checklist
Pre-Migration
- Review current CI/CD (if exists)
- Document project-specific requirements
- Verify project has required scripts (lint, test, build)
- Test scripts locally
Migration
- Copy template workflow
- Customize for project
- Test workflow locally (if possible)
- Commit workflow file
- Push to branch
- Monitor first run
- Fix any issues
Post-Migration
- Monitor for 1-2 weeks
- Gather team feedback
- Document issues
- Refine template based on feedback
- Update documentation
Common Customizations
Adding Database Tests
test:
# ... existing steps
- name: Start database
run: docker-compose up -d postgres
- name: Run tests
run: pnpm test
env:
DATABASE_URL: postgresql://user:pass@localhost:5432/testdb
Adding Docker Build
build:
# ... existing steps
- name: Build Docker image
run: docker build -t project-name:latest .
- name: Push to registry
if: github.ref == 'refs/heads/main'
run: docker push project-name:latest
Adding Deployment
deploy:
needs: [lint, test, build]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Deploy
run: ./scripts/deploy.sh
Feedback Collection
Questions to Ask
-
Workflow execution:
- Are workflows running correctly?
- Any failures or errors?
- Performance issues?
-
Developer experience:
- Is feedback timely?
- Are error messages clear?
- Any missing checks?
-
Template completeness:
- Missing any common steps?
- Any unnecessary steps?
- Suggestions for improvements?
Next Steps
- Select 3-5 pilot projects
- Migrate first project (workspace-shared recommended)
- Monitor and gather feedback
- Refine template
- Migrate remaining pilots
- Roll out to all projects
Last Updated: 2025-01-27