guarding-deployments
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGuarding Deployments
部署防护
When to use this skill
何时使用该Skill
- Before pushing to production or staging branches.
- When the user asks "is it safe to deploy?".
- To verify environment variables and secrets are present.
- 推送至生产或staging分支之前。
- 当用户询问“现在部署安全吗?”时。
- 用于验证环境变量和密钥是否已配置。
Workflow
工作流程
- Preparation
- Identify target environment (e.g., ,
production).staging - List required environment variables.
- Identify target environment (e.g.,
- Verification
- Run linting and type checks.
- Execute test suite with .
npm test - Verify environment variables using .
scripts/check-env.sh
- Execution
- If all checks pass, proceed with deployment command.
- If any check fails, block deployment and report errors.
- 准备阶段
- 确定目标环境(例如:、
production)。staging - 列出所需的环境变量。
- 确定目标环境(例如:
- 验证阶段
- 运行linting和类型检查。
- 执行测试套件:。
npm test - 使用验证环境变量。
scripts/check-env.sh
- 执行阶段
- 若所有检查通过,继续执行部署命令。
- 若任何检查失败,阻止部署并报告错误。
Instructions
操作说明
Linting & Tests
Linting & 测试
Ensure the project is in a clean state:
bash
undefined确保项目处于干净状态:
bash
undefinedRun linting
Run linting
npm run lint
npm run lint
Run unit tests
Run unit tests
npm test
undefinednpm test
undefinedEnvironment Variable Check
环境变量检查
Use the provided script to ensure required keys are set:
bash
./scripts/check-env.sh .env.production DB_URL API_KEY使用提供的脚本确保所需密钥已配置:
bash
./scripts/check-env.sh .env.production DB_URL API_KEYResources
参考资源
- check-env.sh
- Example .env
- check-env.sh
- Example .env