{"id":22051920,"url":"https://github.com/chenchenwuai/deploy-plus","last_synced_at":"2026-03-04T09:02:14.455Z","repository":{"id":118338313,"uuid":"314099142","full_name":"chenchenwuai/deploy-plus","owner":"chenchenwuai","description":"轻量级前端一键自动化部署脚手架服务，支持多环境配置。如果你不想使用jenkins等这些的cicd工具，那就试试这个吧。","archived":false,"fork":false,"pushed_at":"2022-06-17T09:18:09.000Z","size":80,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T05:20:46.328Z","etag":null,"topics":["auto-deploy","deploy","deploy-plus","deploy-server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chenchenwuai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-11-19T01:04:11.000Z","updated_at":"2023-12-15T11:51:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3e797cc-a9e8-4fe8-b6af-b21c75e5a1b7","html_url":"https://github.com/chenchenwuai/deploy-plus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chenchenwuai/deploy-plus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenchenwuai%2Fdeploy-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenchenwuai%2Fdeploy-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenchenwuai%2Fdeploy-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenchenwuai%2Fdeploy-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenchenwuai","download_url":"https://codeload.github.com/chenchenwuai/deploy-plus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenchenwuai%2Fdeploy-plus/sbom","scorecard":{"id":276005,"data":{"date":"2025-08-11","repo":{"name":"github.com/chenchenwuai/deploy-plus","commit":"c5adfeec96978ec00b22000057ec65680f07fcda"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-652h-xwhf-q4h6","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T14:24:29.110Z","repository_id":118338313,"created_at":"2025-08-17T14:24:29.110Z","updated_at":"2025-08-17T14:24:29.110Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30076935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-deploy","deploy","deploy-plus","deploy-server"],"created_at":"2024-11-30T15:12:18.419Z","updated_at":"2026-03-04T09:02:14.449Z","avatar_url":"https://github.com/chenchenwuai.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deploy-plus\n\n前端一键自动化部署脚手架服务，支持开发、测试、生产多环境配置。配置好后一键即可自动完成部署。\n\n### github\n\n[https://github.com/chenchenwuai/deploy-plus](https://github.com/chenchenwuai/deploy-plus)\n\n## 1 安装\n\n全局安装 deploy-plus\n\n```shell\nnpm install deploy-plus -g\n```\n\n本地安装 deploy-plus\n\n```shell\nnpm install deploy-plus --save-dev\n```\n\n查看版本，表示安装成功\n\n```javascript\ndeploy-plus -v\n```\n\n注：本地安装的需要在调用前加 `npx`\n\n```shell\nnpx deploy-plus -v\n```\n\n## 2 使用（以下代码都以全局安装为例）\n\n### 2.1 查看帮助\n\n```shell\ndeploy-plus -h\n```\n\n### 2.2 `init` 初始化配置文件（在项目目录下）\n\n```shell\ndeploy-plus init -fy\n# 或者使用简写\ndeploy-plus i -fy\n```\n\n\u003e 执行 `deploy-plus i -h` 获取使用帮助\n\n参数\n+ `-f` `--force` 强制重新生成配置文件\n+ `-y` `--yes` 全部设置为默认值, 如果后面跟字符串会被当作默认密码,例如: `deploy-plus i -y my-password`\n\n根据提示填写内容，会在项目根目录下生成 `deploy.config.js` 文件，初始化可根据选择的需要部署的环境生成 `dev` (开发环境)、`test` (测试环境)、`prod` (生产环境) 三个配置，再有其他配置可参考模板自行配置。\n\n\u003e 提示：交互输入密码时会自动使用私钥加密，无需手动加密。\n\n如果生成文件时没有输入密码，或者没有默认密码，而后面又想设置密码时，请参考 `2.3节` 生成密码的加密字符串\n\n### 2.3 `encrypt` 加解密密码操作\n\n+ 加密原始密码\n```shell\n# 加密原始密码\ndeploy-plus encrypt 123456\n# 或者使用简写\ndeploy-plus e 123456\n```\n\n加密成功后，控制台会打印出结果，请将结果填写到配置的`password`字段\n\n+ 解密\n```shell\n# 解密\ndeploy-plus e decrypt xxxxx\n# 或者使用简写\ndeploy-plus e -d xxxxx\n```\n`xxxxx` 为加密密码生成的字符串\n\u003e 执行 `deploy-plus e -h` 获取使用帮助\n\n### 2.4 `deploy` 部署文件到服务器\n```shell\ndeploy-plus deploy\n# 或者使用简写\ndeploy-plus d\ndeploy-plus d -by -m prod\n```\n\u003e 执行 `deploy-plus d -h` 获取使用帮助\n\n参数\n+ `-m` `--mode \u003cmode\u003e` 设置部署模式,不设置此参数，则默认 dev，例如：`deploy-plus d -m prod`\n+ `-c` `--cluster` 部署集群,设置此参数后会忽略 -m 参数\n+ `-b` `--build` 设置此参数，会执行打包命令(需保证已填写打包命令配置)\n+ `-y` `--yes` 跳过是否确定部署提示\n\n### 2.5 配置字段解析\n\n\u003e 如需手动配置，只需要在项目根目录下手动创建 `.deploy.config.js` 文件，复制以下代码按情况修改即可。\n\n```javascript\n// 配置字段解析\nmodule.exports = {\n  projectName: 'myProject', // 项目名称\n  privateKey: '/Users/username/.ssh/id_rsa', // id_rsa文件路径\n  passphrase: '',\n  cluster: ['dev','test'], // 集群部署配置，要同时部署多台配置此属性如: ['dev', 'test', 'prod']\n  dev: {\n    // 环境对象\n    name: '开发环境', // 环境名称\n    script: 'npm run build', // 打包命令\n    host: '192.168.0.1', // 服务器地址\n    port: 22, // 服务器端口号\n    username: 'root', // 服务器登录用户名\n    password: '', // 服务器登录密码\n    distPath: 'dist', // 本地打包生成目录\n    webDir: '/usr/local/nginx/html', // 服务器部署路径（不可为空或'/'或'/aaa',至少三级目录）\n    isBackupRemoteFile: true, // 是否备份远程文件（默认true）\n    isCompressBackup: true // 是否压缩备份文件（默认true）\n  },\n  test: {\n    name: '测试环境',\n    script: 'npm run build:test',\n    host: '192.168.0.1',\n    port: 22, \n    username: 'root',\n    password: '',\n    distPath: 'dist',\n    webDir: '/usr/local/nginx/html',\n    isBackupRemoteFile: true,\n    isCompressBackup: true\n  },\n  prod: {\n    name: '生产环境',\n    script: 'npm run build:prod',\n    host: '192.168.0.1',\n    port: 22,\n    username: 'root',\n    password: '',\n    distPath: 'dist',\n    webDir: '/usr/local/nginx/html',\n    isBackupRemoteFile: true,\n    isCompressBackup: true\n  }\n}\n```\n\n### 2.6 本地安装扩展\n\n如果使用本地安装命令的话，可以在项目根目录下的 `package.json` 文件中 `scripts` 脚本中添加如下代码\n\n```json\n\"scripts\": {\n  \"deploy\": \"deploy-plus d\",\n  \"deploy:dev\": \"deploy-plus d -b\",\n  \"deploy:test\": \"deploy-plus d -b -m test\",\n  \"deploy:prod\": \"deploy-plus d -b -m prod\"\n}\n```\n\n然后使用下面代码也可以完成部署操作\n\n```shell\nnpm run deploy:dev\n```\n\n## 3 使用示例\n\n### 3.1 Vue/React 项目部署示例\n\n假设你有一个 Vue 项目，需要部署到开发服务器和生产服务器。\n\n**第一步：安装并初始化**\n\n```shell\n# 在项目根目录下\nnpm install deploy-plus --save-dev\n\n# 初始化配置文件（使用默认密码 123456）\nnpx deploy-plus init -fy 123456\n```\n\n**第二步：修改配置文件 `.deploy.config.js`**\n\n```javascript\nmodule.exports = {\n  projectName: 'my-vue-app',\n  privateKey: '/Users/yourname/.ssh/id_rsa',\n  passphrase: '',\n  cluster: [],\n  dev: {\n    name: '开发环境',\n    script: 'npm run build:dev',\n    host: '192.168.1.100',\n    port: 22,\n    username: 'root',\n    password: 'xxxxxx', // 使用 deploy-plus e 123456 生成的加密字符串\n    distPath: 'dist',\n    webDir: '/var/www/my-vue-app',\n    isBackupRemoteFile: true,\n    isCompressBackup: true\n  },\n  prod: {\n    name: '生产环境',\n    script: 'npm run build:prod',\n    host: '10.0.0.50',\n    port: 22,\n    username: 'deploy',\n    password: 'xxxxxx',\n    distPath: 'dist',\n    webDir: '/var/www/my-vue-app',\n    isBackupRemoteFile: true,\n    isCompressBackup: true\n  }\n}\n```\n\n**第三步：执行部署**\n\n```shell\n# 部署到开发环境（不执行打包，适合已打包的情况）\nnpx deploy-plus d\n\n# 部署到开发环境（先打包再部署）\nnpx deploy-plus d -b\n\n# 部署到生产环境（先打包再部署，跳过确认提示）\nnpx deploy-plus d -by -m prod\n```\n\n### 3.2 集群部署示例\n\n同时部署到多台服务器：\n\n```javascript\n// .deploy.config.js\nmodule.exports = {\n  projectName: 'my-app',\n  privateKey: '/Users/yourname/.ssh/id_rsa',\n  cluster: ['dev', 'test'], // 指定要同时部署的环境\n  dev: {\n    name: '开发服务器1',\n    host: '192.168.1.101',\n    // ... 其他配置\n  },\n  test: {\n    name: '开发服务器2', \n    host: '192.168.1.102',\n    // ... 其他配置\n  }\n}\n```\n\n```shell\n# 执行集群部署（会依次部署到 dev 和 test）\nnpx deploy-plus d -c -b\n```\n\n### 3.3 使用 SSH 密钥认证（免密码）\n\n如果服务器已配置 SSH 密钥认证，可以不设置密码：\n\n```javascript\nmodule.exports = {\n  projectName: 'my-app',\n  privateKey: '/Users/yourname/.ssh/id_rsa', // 确保此私钥已添加到服务器\n  passphrase: '', // 私钥密码，没有则留空\n  dev: {\n    name: '开发环境',\n    host: '192.168.1.100',\n    port: 22,\n    username: 'root',\n    password: '', // 留空，使用密钥认证\n    distPath: 'dist',\n    webDir: '/var/www/html',\n    isBackupRemoteFile: false, // 不备份远程文件\n    isCompressBackup: false\n  }\n}\n```\n\n### 3.4 完整工作流示例\n\n```shell\n# 1. 初始化配置\ndeploy-plus init\n\n# 2. 加密密码并填入配置\ndeploy-plus encrypt your-server-password\n\n# 3. 部署前先测试配置（不打包，手动确认）\ndeploy-plus d -m dev\n\n# 4. 正式部署（打包 + 部署 + 跳过确认）\ndeploy-plus d -by -m prod\n```\n\n## 4 常见问题\n\n### Q: 部署失败提示 \"ssh连接失败\"\n- 检查服务器地址、端口、用户名是否正确\n- 检查密码是否正确加密\n- 检查私钥文件路径是否存在\n\n### Q: 部署失败提示 \"webDir 配置不正确\"\n- `webDir` 必须是至少三级的绝对路径，如 `/var/www/html`\n- 不能是 `/` 或 `/var` 这样的少于三级的目录（安全限制）\n\n### Q: 如何查看加密后的密码对应的原始密码？\n```shell\ndeploy-plus e -d 加密字符串\n```\n\n### Q: 备份文件太大怎么办？\n- 设置 `isCompressBackup: true` 会将备份压缩为 `.tar.gz` 文件\n- 设置 `isBackupRemoteFile: false` 可以关闭备份功能\n\n### Q: 备份文件在哪里？\n- 备份文件位于 `webDir` 的同级目录，命名格式为 `{webDir}_backup_{YYYYMMDD_HHmmss}.tar.gz`\n\n最后如果大家觉得还不错挺好用的话，麻烦给个 Star 😜😜😜。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenchenwuai%2Fdeploy-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenchenwuai%2Fdeploy-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenchenwuai%2Fdeploy-plus/lists"}