DevOps-MCPS是一个具备GitHub代码搜索、Jenkins任务管理和Slack通知集成等功能的项目,能有效助力DevOps流程的自动化和管理。
本项目提供了多种安装方式,你可以根据自己的需求进行选择。
pip install devops-mcps
pip install "devops-mcps==0.15.0"
git clone https://github.com/your-org/devops-mcps.git
cd devops-mcps
python -m pip install -e .
项目依赖以下环境变量:
GITHUB_API_TOKEN:GitHub API访问令牌,用于GitHub搜索功能。JENKINS_SERVER_URL:Jenkins服务器URL地址。SLACK_WEBHOOK_URL:Slack机器人Webhook URL。日志默认输出到控制台。如需调整日志级别或格式,请编辑logging.ini文件:
[loggers]
keys = root, devops_mcps
[handlers]
keys = consoleHandler
[formatters]
keys = simpleFormatter
[logger_root]
level = NOTSET
handlers =
qualname =
[logger_devops_mcps]
level = INFO
handlers = consoleHandler
qualname = devops_mcps
[handler_consoleHandler]
class = StreamHandler
level = NOTSET
formatter = simpleFormatter
args = (sys.stderr,)
[formatter_simpleFormatter]
format = %(asctime)s - %(levelname)-5s - %(module)s:%(lineno)d - %(message)s
datefmt = %H:%M:%S
src/
├── devops_mcps/
│ ├── __init__.py
│ ├── cli.py
│ └── services/
│ ├── jenkins_service.py
│ └── slack_notifier.py
tests/
├── test_cli.py
└── test_jenkins_service.py
使用uv进行依赖管理:
# 安装基本依赖
uv pip install -r requirements.txt
# 同步锁定文件
uv lock update
devops-mcps gh-search-code --query "fastapi" --language python
devops-mcps jenkins-job status --job_name my_job
devops-mcps slack notify --message "构建完成,请检查结果"
遵循Conventional Commits规范进行代码提交。
如遇问题,请访问GitHub Issues页面提交: https://github.com/your-org/devops-mcps/issues
pytest tests/
pytest tests/test_cli.py -v
coverage run -m pytest tests/ && coverage report
集成测试配置在tests/integration_test.py文件中,需确保已配置好相关环境变量。
项目使用GitHub Actions进行持续集成。以下是主要工作流配置:
name: CI-CD
on:
push:
branches: [ main ]
pull_request:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
run: pytest --cov .
本项目遵循MIT License协议。具体许可证内容如下:
The MIT License (MIT)
Copyright (c) 2023 Your Name
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| 属性 | 详情 |
|---|---|
| 模型类型 | 无 |
| 训练数据 | 无 |
| 工具依赖 | Python 3.8+;Jenkins API Client(用于与Jenkins服务器交互);Slack API Wrapper(集成Slack机器人功能) |
感谢以下贡献者: