CI/CD Pipeline Toolkit
by @kaiyuelv
Automate CI/CD pipelines for GitHub Actions, GitLab CI, and Jenkins with build, test, deploy workflow creation and pipeline status monitoring.
clawhub install ci-cd-pipeline-toolkit📖 About This Skill
CI/CD Pipeline Toolkit
Metadata
Capabilities
Actions
#### github_actions_workflow_create Create GitHub Actions workflow file
#### gitlab_ci_config_generate Generate GitLab CI/CD configuration
#### jenkins_pipeline_create Create Jenkins pipeline script
#### pipeline_status_check Check CI/CD pipeline execution status
#### deployment_trigger Trigger deployment to environment
Requirements
Examples
GitHub Actions Workflow
from cicd_toolkit import GitHubActionsWorkflowCreate Python CI workflow
workflow = GitHubActionsWorkflow("python-ci")
workflow.add_trigger("push", branches=["main", "dev"])
workflow.add_trigger("pull_request")Add jobs
workflow.add_job("test", {
"runs-on": "ubuntu-latest",
"steps": [
{"uses": "actions/checkout@v4"},
{"uses": "actions/setup-python@v4", "with": {"python-version": "3.11"}},
{"name": "Install dependencies", "run": "pip install -r requirements.txt"},
{"name": "Run tests", "run": "pytest"}
]
})workflow.save(".github/workflows/python-ci.yml")
GitLab CI Configuration
from cicd_toolkit import GitLabCIConfigGenerate CI config
config = GitLabCIConfig()
config.add_stage("build")
config.add_stage("test")
config.add_stage("deploy")config.add_job("build_app", {
"stage": "build",
"script": ["npm install", "npm run build"],
"artifacts": {"paths": ["dist/"]}
})
config.add_job("test_app", {
"stage": "test",
"script": ["npm run test"],
"needs": ["build_app"]
})
config.save(".gitlab-ci.yml")
Scripts
scripts/github_workflow_generator.py: GitHub Actions工作流生成器scripts/gitlab_ci_generator.py: GitLab CI配置生成器scripts/jenkins_pipeline_generator.py: Jenkins流水线生成器scripts/pipeline_monitor.py: 流水线监控工具Installation
pip install -r requirements.txt
Usage
# Generate GitHub Actions workflow
python scripts/github_workflow_generator.py --name python-ci --type pytestGenerate GitLab CI config
python scripts/gitlab_ci_generator.py --stages build,test,deployMonitor pipeline status
python scripts/pipeline_monitor.py --platform github --repo owner/repo
License
MIT License💡 Examples
GitHub Actions Workflow
from cicd_toolkit import GitHubActionsWorkflowCreate Python CI workflow
workflow = GitHubActionsWorkflow("python-ci")
workflow.add_trigger("push", branches=["main", "dev"])
workflow.add_trigger("pull_request")Add jobs
workflow.add_job("test", {
"runs-on": "ubuntu-latest",
"steps": [
{"uses": "actions/checkout@v4"},
{"uses": "actions/setup-python@v4", "with": {"python-version": "3.11"}},
{"name": "Install dependencies", "run": "pip install -r requirements.txt"},
{"name": "Run tests", "run": "pytest"}
]
})workflow.save(".github/workflows/python-ci.yml")
GitLab CI Configuration
from cicd_toolkit import GitLabCIConfigGenerate CI config
config = GitLabCIConfig()
config.add_stage("build")
config.add_stage("test")
config.add_stage("deploy")config.add_job("build_app", {
"stage": "build",
"script": ["npm install", "npm run build"],
"artifacts": {"paths": ["dist/"]}
})
config.add_job("test_app", {
"stage": "test",
"script": ["npm run test"],
"needs": ["build_app"]
})
config.save(".gitlab-ci.yml")