Skip to main content

CI/CD

GitLab CI + Docker Compose + Traefik.


Environments

EnvironmentURLTrigger
devhttps://dev-glamb.happydev.techPush to dev branch
productionhttps://glamb.happydev.techPush to main branch

Pipeline Stages

test  →  dev/main  →  cleanup
JobTriggerAction
test-jobAll branchesbundle exec rspec via ci-cd/test/
lint-jobAll branchesrubocop without DB (parallel with test-job)
lint-fixManualrubocop -A + commit back to branch
start-devdev branchdocker compose up -d ci-cd/dev/
start-mainmain branchdocker compose up -d ci-cd/prod/
cleanupAlwaysdocker image prune -f

test-job and lint-job run in parallel. Both must pass before deployment.


Git Flow

feature/* or fix/*
→ PR → dev (auto-deploy to dev environment)
→ PR → main (auto-deploy to production)

Required Secrets (GitLab CI Variables)

RAILS_MASTER_KEY
SECRET_KEY_BASE
DBUSER · DBPASS · DBNAME · DBPORT
ACTIVE_RECORD_KEY_SALT
ACTIVE_RECORD_PRIMARY_KEY
ACTIVE_RECORD_DETERMINISTIC_KEY
SWAGGER_USER · SWAGGER_PASSWORD # dev only
GIT_ACCESS_TOKEN # lint-fix only

Docker Files

FilePurpose
docker-compose.ymlLocal development
ci-cd/test/RSpec in pipeline
ci-cd/dev/Deploy to dev server
ci-cd/prod/Deploy to production
ci-cd/lint/lint-fix with volume mount

ci-cd/ composes are never run locally.