{"id":15046313,"url":"https://github.com/cipchk/ng-deploy-oss","last_synced_at":"2025-10-26T17:31:10.625Z","repository":{"id":39441898,"uuid":"253240361","full_name":"cipchk/ng-deploy-oss","owner":"cipchk","description":"Deploy Angular apps to aliyun OSS, qiniu, upyun using the Angular CLI. 🚀","archived":false,"fork":false,"pushed_at":"2024-11-24T06:21:28.000Z","size":2059,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-31T15:04:44.239Z","etag":null,"topics":["aliyun-oss","angular","angular-cli","angular-schematics","ng-deploy","qiniu","typescript","upyun"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/cipchk.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}},"created_at":"2020-04-05T13:23:14.000Z","updated_at":"2024-11-24T06:21:30.000Z","dependencies_parsed_at":"2023-11-09T12:40:03.264Z","dependency_job_id":"25b117bd-d666-43dd-8fc9-ff722d861e40","html_url":"https://github.com/cipchk/ng-deploy-oss","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"da87e6308157c281414cfa6d7e561656e36bbcdb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipchk%2Fng-deploy-oss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipchk%2Fng-deploy-oss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipchk%2Fng-deploy-oss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipchk%2Fng-deploy-oss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cipchk","download_url":"https://codeload.github.com/cipchk/ng-deploy-oss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238275672,"owners_count":19445250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aliyun-oss","angular","angular-cli","angular-schematics","ng-deploy","qiniu","typescript","upyun"],"created_at":"2024-09-24T20:52:58.809Z","updated_at":"2025-10-26T17:31:05.145Z","avatar_url":"https://github.com/cipchk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ng-deploy-oss\n\n[![npm](https://img.shields.io/npm/v/ng-deploy-oss)](https://www.npmjs.com/package/ng-deploy-oss)\n![CI](https://github.com/cipchk/ng-deploy-oss/workflows/CI/badge.svg)\n[![The MIT License](https://img.shields.io/badge/license-MIT-orange.svg?color=blue\u0026style=flat-square)](http://opensource.org/licenses/MIT)\n\n**使用 Angular CLI 发布 Angular 应用到阿里云 OSS、七牛云、又拍云 🚀**\n\n## 快速入门\n\n1、安装 Angular CLI (v8.3.0 以上) 并创建一个新项目\n\n```bash\nnpm install -g @angular/cli\nng new hello-world\ncd hello-world\n```\n\n2、添加 `ng-deploy-oss`\n\n```bash\nng add ng-deploy-oss\n```\n\n\u003e 除 [通用参数](#通用参数) 以外，同时阿里云 OSS、七牛云、又拍云三种云存储，不同的类型需要的参数不同，更多细节请参考[不同参数](#不同参数)。\n\n3、部署\n\n```bash\nng deploy\n```\n\n## 参数\n\n### 通用参数\n\n| 参数名 | 默认值 | 描述 |\n|-----|-----|----|\n| `noBuild` | `false` | 是否不执行构建命令 |\n| `buildCommand` | `-` | 自定义构建命令行 |\n| `baseHref` | `-` | 指定 `baseHref` 参数，赞同 `ng build --base-href=xx` 值 |\n| `preClean` | `true` | 是否预清除所有远程目录下的文件 |\n| `oneByOneUpload` | `false` | 是否逐个上传文件，并且将所有 html 放在最后上传 |\n\n### 不同参数\n\n**阿里云 OSS**\n\n| 参数名 | 环境变量名 | 描述 |\n|-----|-------|----|\n| `region` | `ALIOSS_REGION` | OSS Region，完整列表请参考[OSS 开通 Region 和 Endpoint 对照表](https://help.aliyun.com/document_detail/31837.html) |\n| `ak` | `ALIOSS_AK` | 阿里云 AccessKeyId |\n| `sk` | `ALIOSS_SK` | 阿里云 AccessKeySecret |\n| `stsToken` | `ALIOSS_STSTOKEN` | 阿里云 STS Token |\n| `bucket` | `ALIOSS_BUCKET` | Bucket |\n| `prefix` | `ALIOSS_PREFIX` | 路径前缀，如果不指定表示放在根目录下 |\n| `buildCommand` | `ALIOSS_BUILDCOMMAND` | 构建生产环境的 NPM 命令行（例如：`npm run build`），若为空表示自动根据 `angular.json` 构建生成环境 |\n\n**七牛云**\n\n| 参数名 | 环境变量名 | 描述 |\n|-----|-------|----|\n| `ak` | `QINIU_AK` | 七牛云 AccessKey |\n| `sk` | `QINIU_SK` | 七牛云 SecretKey |\n| `zone` | `QINIU_ZONE` | 所在机房 |\n| `bucket` | `QINIU_BUCKET` | Bucket |\n| `prefix` | `QINIU_PREFIX` | 路径前缀，如果不指定表示放在根目录下 |\n| `buildCommand` | `QINIU_BUILDCOMMAND` | 构建生产环境的 NPM 命令行（例如：`npm run build`），若为空表示自动根据 `angular.json` 构建生成环境 |\n\n**又拍云**\n\n| 参数名 | 环境变量名 | 描述 |\n|-----|-------|----|\n| `name` | `UPYUN_NAME` | 服务名称 |\n| `operatorName` | `UPYUN_OPERATORNAME` | 操作员名称（确保可写入\u0026可删除权限） |\n| `operatorPwd` | `UPYUN_OPERATORPWD` | 操作员密码 |\n| `prefix` | `UPYUN_PREFIX` | 路径前缀，如果不指定表示放在根目录下 |\n| `buildCommand` | `UPYUN_BUILDCOMMAND` | 构建生产环境的 NPM 命令行（例如：`npm run build`），若为空表示自动根据 `angular.json` 构建生成环境 |\n\n### 使用环境变量\n\n当运行 `ng add ng-deploy-oss` 时会根据所选的类型提示输入相应的参数，并把这些参数写入 `angular.json` 中。事实上，对于这些参数属于私密强的信息，这时候可以利用环境变量，来保护这些私密信息。\n\n例如，当生产环境部署时，使用不同的 `ALIOSS_AK` 参数时：\n\n```bash\n# Windows：\nset ALIOSS_AK=prod\n# on OS X or Linux：\nexport ALIOSS_AK=prod\n```\n\n### 使用命令行\n\n命令行参数也可以改变其参数值，但它的优先级会低于环境变量方式，高于 `angular.json` 配置的信息。\n\n```bash\nng deploy --ak=prod\n```\n\n## License\n\nThe MIT License (see the [LICENSE](https://github.com/cipchk/ng-deploy-oss/blob/master/LICENSE) file for the full text)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcipchk%2Fng-deploy-oss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcipchk%2Fng-deploy-oss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcipchk%2Fng-deploy-oss/lists"}