gitlab ci drupal template
Drupal CI: drupal-master Component (Authoritative)
Status: Production
Owner: Agent platform CI; single source of truth for all Drupal module/theme/recipe pipelines.
Component: gitlab_components → drupal-master
Wiki: /Volumes/AgentPlatform/applications/wikis (this file + gitlab_components.wiki/components/drupal-master.md)
Overview
All Drupal projects use one GitLab CI component: drupal-master. One include in .gitlab-ci.yml provides:
- Lint: PHP syntax,
composer validate,*.info.ymlvalidation - Quality: PHPCS (Drupal/DrupalPractice), optional PHPStan
- Test: Install test (fresh Drupal, enable module, validate services/config, uninstall)
- Package: Composer package → GitLab Package Registry (all projects)
- Release: Branch sync and/or tag push to git.drupalcode.org (drupal.org projects only)
Two modes:
- GitLab-only – No drupal.org; lint, quality, test, Composer package on GitLab.com.
- drupal.org – Same plus sync to git.drupalcode.org (branch on push to
release_branch, tag on tag push).
Component Reference
- Include:
$CI_SERVER_FQDN/blueflyio/gitlab_components/drupal-master@release/v0.1.x - Repo: https://gitlab.com/blueflyio/gitlab_components
- Template:
templates/drupal-master/template.yml - Detailed spec: gitlab_components.wiki → Drupal Master Component
Standard .gitlab-ci.yml
GitLab-only (no drupal.org)
include: - component: $CI_SERVER_FQDN/blueflyio/gitlab_components/drupal-master@release/v0.1.x inputs: php_version: "8.3" drupal_core: "11" phpcs_enabled: "true" composer_package: "true" enable_drupalorg: "false"
drupal.org (branch sync + tag release)
include: - component: $CI_SERVER_FQDN/blueflyio/gitlab_components/drupal-master@release/v0.1.x inputs: php_version: "8.3" drupal_core: "11" phpcs_enabled: "true" composer_package: "true" enable_drupalorg: "true" drupal_project: "PROJECT_MACHINE_NAME" release_branch: "release/v0.1.x" drupalorg_sync_branch: "true"
Replace PROJECT_MACHINE_NAME with the drupal.org project name (e.g. api_normalization).
Required CI Variable (drupal.org only)
For projects with enable_drupalorg: "true" the release job pushes to git.drupalcode.org and requires:
| Variable | Type | Description |
|---|---|---|
DEPLOY_DRUPALORG_TOKEN | Variable (masked) | drupal.org project access token with write_repository |
- Create token: https://git.drupalcode.org/project/PROJECT_NAME/-/settings/access_tokens
- In GitLab: Project → Settings → CI/CD → Variables → Add
DEPLOY_DRUPALORG_TOKEN
Without it, the release:drupalorg job fails with instructions to set the variable.
Key Inputs (summary)
| Input | Default | Description |
|---|---|---|
php_version | "8.3" | PHP version for all jobs |
drupal_core | "11" | Drupal core major (10 or 11) |
phpcs_enabled | "true" | Run PHPCS |
composer_package | "true" | Publish Composer package to GitLab |
enable_drupalorg | "false" | Enable push to git.drupalcode.org |
drupal_project | "" | drupal.org project machine name (required if enable_drupalorg) |
release_branch | "main" | Branch to sync/push (set to release/v0.1.x for platform) |
drupalorg_sync_branch | "true" | On push to release_branch, sync that branch to drupalcode.org |
install_test | "true" | Install on fresh Drupal, validate, uninstall |
docs_enabled | "false" | MkDocs → GitLab Pages |
docs_versioning | "false" | Use mike for versioned docs |
docs_version_name | "" | Version name for mike |
Full list: gitlab_components repo templates/drupal-master/template.yml (spec.inputs).
Projects Using drupal-master
All 24 custom modules use drupal-master. Consistency: same component ref, same branch release/v0.1.x where applicable.
GitLab-only (no drupal.org)
| Module | Notes |
|---|---|
| ai_agents_communication | |
| ai_agents_orchestra | |
| ai_provider_apple | |
| ai_provider_langchain | |
| apidog_integration | |
| blockchain_manager |
drupal.org (branch sync + tag release)
| Module | drupal_project | release_branch |
|---|---|---|
| api_normalization | api_normalization | release/v0.1.x |
| agentic_canvas_blocks | agentic_canvas_blocks | release/v0.1.x |
| ai_agents_claude | ai_agents_claude | release/v0.1.x |
| ai_agents_client | ai_agents_client | release/v0.1.x |
| ai_agents_crewai | ai_agents_crewai | release/v0.1.x |
| ai_agents_cursor | ai_agents_cursor | release/v0.1.x |
| ai_agents_huggingface | ai_agents_huggingface | release/v0.1.x |
| ai_agents_kagent | ai_agents_kagent | release/v0.1.x |
| ai_agents_ossa | ai_agents_ossa | release/v0.1.x |
| alternative_services | alternative_services | release/v0.1.x |
| cedar_policy | cedar_policy | release/v0.1.x |
| code_executor | code_executor | release/v0.1.x |
| dita_ccms | dita_ccms | release/v0.1.x |
| drupal_patch_framework | drupal_patch_framework | release/v0.1.x |
| external_migration | external_migration | release/v0.1.x |
| layout_system_converter | layout_system_converter | release/v0.1.x |
| mcp_registry | mcp_registry | release/v0.1.x |
| recipe_onboarding | recipe_onboarding | release/v0.1.x |
Pipeline Flow
- Lint – php-lint, composer-validate, info-yml-validate
- Quality – phpcs (optional phpstan)
- Test – install-test (fresh Drupal, enable, validate services/config, uninstall)
- Package – composer-package (GitLab Package Registry)
- Release (if enable_drupalorg) – release:drupalorg runs after quality (needs: phpcs); syncs branch on push to release_branch, pushes tag on tag push.
Release job does not wait for install-test; it runs once quality passes so drupalcode.org stays in sync even if install-test fails.
Verification
- GitLab pipelines:
https://gitlab.com/blueflyio/agent-platform/drupal/<project>/-/pipelines - drupalcode.org pipelines:
https://git.drupalcode.org/project/<project>/-/pipelines - After a successful push to
release/v0.1.x, drupalcode.org should show a new pipeline for that branch (if DEPLOY_DRUPALORG_TOKEN is set).
Adding a New Drupal Project
- Create
.gitlab-ci.ymlwith one include (GitLab-only or drupal.org block above). - For drupal.org: set
drupal_project,release_branch,drupalorg_sync_branch, and addDEPLOY_DRUPALORG_TOKENin project CI/CD variables. - Push to
release/v0.1.x(or your release_branch); pipeline runs and, for drupal.org, syncs to git.drupalcode.org.