Skip to content

Lyt060814/Claude-Code-Autudeploy

Repository files navigation

Auto-Deployment System using Claude Code

A fully automated GitHub project deployment, testing, and documentation generation system that supports batch processing of multiple projects with automatic deployment documentation and RAG data upload.

📊 Performance Statistics

🎯 Deployment Success Rate: 92.3% (60/65 projects)

💰 Average Cost: $0.71 per deployment

⏱️ Average Time: 8.7 minutes per project

These statistics demonstrate the system's reliability, cost-effectiveness, and efficiency in handling diverse GitHub projects.

🚀 Features

  • Automated Deployment: Uses Claude AI to automatically analyze projects and execute deployments
  • Batch Processing: Supports deploying multiple GitHub projects simultaneously
  • Smart Environment Detection: Automatically detects system environment and adapts deployment strategies
  • Documentation Generation: Automatically generates deployment guides and issue resolution documentation
  • RAG Integration: Automatically uploads deployment issues to RAG knowledge base
  • Conda Support: Automatically creates and manages conda environments

📁 Project Structure

testCC/
├── auto_deploy_all.py          # Main deployment script (Python)
├── autodeploy.js              # Node.js deployment executor
├── rag.py                     # RAG data upload script
├── deploy.sh                  # Quick deployment launcher script
├── prompt.md                  # Deployment prompt template
├── projects/                  # Cloned project code directory
├── wechat/                    # Generated documentation and JSON files
│   └── {project_name}/        # Documentation directory for each project
│       ├── {project_name}_deployment.md
│       ├── {project_name}_deployment_guide.json
│       └── {project_name}_deployment_issues_solution.json
└── package.json               # Node.js dependency configuration

🛠️ Requirements

System Requirements

  • Operating System: macOS, Linux, Windows
  • Python: 3.7+
  • Node.js: 14+
  • Conda: For environment management

Dependencies

  • Python: requests
  • Node.js: @anthropic-ai/claude-code, diskusage, systeminformation, dotenv, tsx

📦 Installation

  1. Clone Repository
git clone <repository-url>
cd testCC
  1. Install Node.js Dependencies
npm install
  1. Install Python Dependencies
pip install requests
  1. Configure Environment Variables Create .env file:
ANTHROPIC_AUTH_TOKEN=your_anthropic_token
ANTHROPIC_BASE_URL=your_anthropic_base_url
  1. Set Execution Permissions
chmod +x deploy.sh
chmod +x auto_deploy_all.py

🚀 Usage

Quick Start

Using shell script (recommended):

./deploy.sh https://github.com/username/project-name

Batch Deployment

./deploy.sh \
  https://github.com/black-forest-labs/flux \
  https://github.com/Stability-AI/generative-models \
  https://github.com/username/another-project

Direct Python Script Usage

python3 auto_deploy_all.py https://github.com/username/project-name

🔧 Core Components

1. AutoDeployManager (auto_deploy_all.py)

  • Function: Batch project manager
  • Features:
    • Automatically extracts project names
    • Modifies URLs in configuration files
    • Executes deployment processes
    • Generates deployment documentation
    • Runs RAG upload

2. Node.js Deployment Executor (autodeploy.js)

  • Function: Interacts with Claude AI to execute deployments
  • Features:
    • System environment detection
    • Disk space checking
    • Real-time deployment progress display
    • Error handling and logging

3. RAG Data Uploader (rag.py)

  • Function: Uploads deployment issues to RAG knowledge base
  • Features:
    • Parses JSON issue files
    • Batch uploads to server
    • Error retry mechanism
    • Progress statistics

📋 Deployment Process

  1. Project Analysis: Extract project information from GitHub URL
  2. Environment Detection: Analyze system environment and resources
  3. Configuration Update: Modify relevant configuration files
  4. Code Cloning: Clone project to local directory
  5. Environment Creation: Create isolated environment using conda
  6. Dependency Installation: Install project dependencies
  7. Project Building: Execute build and test processes
  8. Documentation Generation: Create deployment guides and issue solutions
  9. RAG Upload: Upload issue data to knowledge base

📊 Output Files

Each successfully deployed project generates:

Deployment Documentation

  • {project_name}_deployment.md: Complete deployment process documentation
  • {project_name}_deployment_guide.json: Structured deployment steps
  • {project_name}_deployment_issues_solution.json: Issue resolution solutions

Project Code

  • projects/{project_name}/: Complete project source code

🔍 Troubleshooting

Common Issues

  1. Environment Variables Not Set

    Error: ANTHROPIC_AUTH_TOKEN not set
    Solution: Check .env file configuration
    
  2. Conda Environment Creation Failed

    Error: conda create failed
    Solution: Ensure conda is properly installed and configured
    
  3. Network Connection Issues

    Error: Request timeout
    Solution: Check network connection and proxy settings
    

Log Viewing

Detailed logs during deployment are displayed in real-time in the terminal, including:

  • System environment information
  • Deployment step progress
  • Error messages and solutions
  • Final statistics

🤝 Contributing

Issues and Pull Requests are welcome to improve this project!

📄 License

ISC License

🔗 Related Links


Generated by TestCC Auto-Deploy System

About

An Autodeploy Agent using Claude Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published