whmcs-gitlab-ci
GitLab CI/CD for WHMCS
SKILL.mdskills/whmcs-gitlab-ci/SKILL.md
GitHubWHMCS GitLab CI/CD Skill
Overview
This skill provides patterns for configuring GitLab CI/CD for WHMCS.
Implementation Patterns
GitLab CI Manager
<?php
/**
* WHMCS GitLab CI/CD
* Manages GitLab CI configuration
*/
namespace WHMCS\Module\DevOps\GitLab;
class GitLabCIManager {
/**
* Generate .gitlab-ci.yml
*/
public function generateCIConfig(): string {
return <<<YAML
stages:
- lint
- test
- build
- deploy
lint:
stage: lint
script:
- composer install
- vendor/bin/phpcs
test:
stage: test
services:
- mysql:8.0
script:
- cp .env.example .env
- composer install
- vendor/bin/phpunit
build:
stage: build
script:
- docker build -t whmcs:\$CI_COMMIT_SHA .
deploy:
stage: deploy
only:
- main
script:
- echo "Deploying..."
YAML;
}
}
Best Practices
- Pipeline Stages: Clear pipeline stages
- Caching: Use dependency caching
- Artifacts: Pass build artifacts between jobs
- Environment: Use GitLab environments
- Review Apps: Auto-create review apps
Related Skills
- whmcs-github-actions
- whmcs-jenkins-pipeline
- whmcs-cicd-integration
- whmcs-gitops-workflow