# auto-deploy **Repository Path**: boranli_admin/auto-deploy ## Basic Information - **Project Name**: auto-deploy - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-13 - **Last Updated**: 2026-07-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # auto-deploy `auto-deploy` is a simplified Huawei Cloud single-ECS web app deployment skill. It is scoped to one-machine deployments. Clustered, high-availability, and multi-resource production architectures are intentionally outside this skill. It is intentionally optimized for the shortest successful path: 1. Analyze the repo. 2. Generate a small deployment plan. 3. Provision one ECS with bundled Terraform. 4. Upload source code over SSH. 5. Start the app and verify health. ## Main Command ```bash python scripts/auto_deploy.py --repo /path/to/app --app-name demo-api --region cn-north-4 --yes ``` ## Common Variants Plan only: ```bash python scripts/auto_deploy.py --repo /path/to/app --app-name demo-api --region cn-north-4 --plan-only ``` Validate Terraform only: ```bash python scripts/auto_deploy.py --repo /path/to/app --app-name demo-api --region cn-north-4 --validate-only --skip-preflight ``` Reuse an existing VPC/subnet: ```bash python scripts/auto_deploy.py --repo /path/to/app --app-name demo-api --network-mode reuse --existing-vpc-id --existing-subnet-id --yes ``` Restrict ports: ```bash python scripts/auto_deploy.py --repo /path/to/app --app-name demo-api --app-port 8081 --no-http --no-https --public-cidr 203.0.113.10/32 --ssh-cidr 198.51.100.7/32 --yes ``` Resume a failed deploy after infrastructure already exists: ```bash python scripts/auto_deploy.py --repo /path/to/app --app-name demo-api --workdir /path/to/app/.auto-deploy --resume-from deploy --skip-prepare --skip-upload ``` Docker cold builds can take longer on first deploy because large base images are pulled through the ECS EIP. Docker and Docker Compose deployments default to a `200 Mbps` EIP bandwidth recommendation, while native deployments keep the lighter `5 Mbps` default. Docker build timeout defaults to `2400` seconds and can be overridden: ```bash python scripts/auto_deploy.py --repo /path/to/app --app-name demo-api --docker-build-timeout 3600 --yes ``` Inject application configuration without uploading `.env`: ```bash python scripts/auto_deploy.py --repo /path/to/app --app-name demo-api --env DATABASE_URL=postgres://... --env JWT_SECRET=... --yes python scripts/auto_deploy.py --repo /path/to/app --app-name demo-api --env-file ./deploy.env --yes ``` If analysis detects required variables and `--yes` is used, missing keys fail fast. Use `--allow-missing-env` only when you accept the deployment risk. ## Supported Deploy Paths - `native`: preferred for recognizable Node.js, Python, Java, Go, Rust, and .NET web apps. - `docker-compose`: used when the repo explicitly ships a Compose app. - `docker`: used only when the repo is container-first and no clear native runtime was detected. Frontend/backend split projects should use Docker Compose. Native split deployment is blocked by default; `--allow-native-fullstack` is an explicit override for simple projects. Removed from the main path: - Artifact-native fallback - Static-only special deployer - Kubernetes deployer - Clustered or multi-ECS deployment - RDS/Redis/OBS/MQ/ELB/CCE/Kubernetes stacks Prepare external databases, Redis, queues, or object storage separately, then inject their connection values with `--env` or `--env-file`. Reports and summary files show env key names only, never values. SSH ingress defaults to the detected control-machine public IP `/32`. If public IP detection fails, provide `--ssh-cidr x.x.x.x/32`; use `--ssh-cidr 0.0.0.0/0` only when intentionally opening SSH to the internet. ## Why It Is Faster Now - Preflight runs after analysis and skips Docker Hub checks for native apps. - SSH keys are reused and generated as `ed25519`, not regenerated as timestamped `RSA 4096`. - Region/flavor/image resolution no longer runs as a separate workflow stage. - VPC conflict handling uses a direct Huawei Cloud API precheck before apply. - Deploy no longer does duplicate Docker pre-install plus fallback orchestration. - Failed deploy recovery can resume from `deploy` or `verify` without rerunning Terraform. - Docker build timeouts retry once to reuse partially downloaded layers. - Previous timing/report files are archived as `*-attempt-N.*` before a resume overwrites canonical outputs. ## Outputs Each run writes under `/.auto-deploy`: - `analysis.json` - `resource-spec.json` - `deployment-plan.md` - `timings.json` - `run-summary.json` - `deployment-test-report.md` ## Cleanup ```bash python scripts/destroy.py --workdir .auto-deploy/terraform ``` Destroy only through the recorded Terraform workdir.