# @financial-times/origami-service-makefile 中文文档

规范地址：https://npmcn.com/package/%40financial-times/origami-service-makefile/

版本：7\.0\.3
npm 元数据更新时间：2026-10-06T13:40:06.196Z
中文译文更新时间：2026-11-14T18:23:10.515Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40financial-times/origami-service-makefile
原文对照：https://npmcn.com/package/%40financial-times/origami-service-makefile/?lang=original
项目主页：https://github.com/Financial-Times/origami-service-makefile
源码仓库：https://github.com/Financial-Times/origami-service-makefile

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：19.6 kB，13 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：0 个
- 首次发布：2017-07-05T13:49:29.993Z
- 最新版本发布：2020-04-09T23:26:46.662Z
- 近 30 天下载量：30119（2026-10-15 至 2026-11-13，npm 官方下载统计）
- 已发布版本数：22（近 12 个月 0 个）

## 中文简介

建立和管理 " origami " 服务的共同工具

## 安装

```sh
npm install @financial-times/origami-service-makefile
```

也可以使用：`pnpm add @financial-times/origami-service-makefile`、`yarn add @financial-times/origami-service-makefile`、`bun add @financial-times/origami-service-makefile`

## README

# 折纸服务 Make 文件

建立和管理 " origami " 服务的共同工具.

[![NPM version](https://img.shields.io/npm/v/@financial-times/origami-service-makefile.svg)](https://www.npmjs.com/package/@financial-times/origami-service-makefile) [![Build status](https://img.shields.io/circleci/project/Financial-Times/origami-service-makefile.svg)](https://circleci.com/gh/Financial-Times/origami-service-makefile) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)

## 目录

-   [使用量](https://npmcn.com/package/%40financial-times/origami-service-makefile/#readme-usage)
-   [配置](https://npmcn.com/package/%40financial-times/origami-service-makefile/#readme-configuration)
-   [联系人](https://npmcn.com/package/%40financial-times/origami-service-makefile/#readme-contact)
-   [许可证](https://npmcn.com/package/%40financial-times/origami-service-makefile/#readme-licence)

## 使用量

Origami Service Makefile提供一套共同的工具,是建设和运行Origami服务所需的. 要使用 Make 文件, 请复制 [`boilerplate.mk`](https://npmcn.com/package/%40financial-times/origami-service-makefile/boilerplate.mk) 文件到您的 repo 根并命名 `Makefile`数字 :

```sh
curl https://raw.githubusercontent.com/Financial-Times/origami-service-makefile/master/boilerplate.mk > Makefile
```

现在安装此模块并保存到您的 `package.json` 文件 :

```sh
npm install --save @financial-times/origami-service-makefile
```

您现在应该可以运行以下命令 :

```
make install       # Install application dependencies
make verify        # Verify code using static analysis
make test          # Run unit and integration tests
make run           # Run the application as if in production
make run-dev       # Run the application and restart when files change
make deploy        # Deploy the application to QA
make release       # Run required tasks before a release goes live
make promote       # Promote a QA deploy to production
make auto-version  # Auto-version the repo and create a GitHub release
make cmdb-update   # Update CMDB endpoints for the application
make release-log   # Create a release log for the application in Salesforce
make grafana-pull  # Pull changes from the Grafana dashboard
make grafana-push  # Push changes to the Grafana dashboard
```

## 配置

Origami Service Makefile可以在扩展的Makefile或外部配置出\[环境变量\]. 由于安全原因,一些配置永远不能投入使用,这些配置在下文中已分开.

### 安全配置

这些配置可以安全包含在您的扩展中 `Makefile`,以及 _应_ 保存在那里,以避免重复其价值观:

-   `SERVICE_NAME`:这一服务的人可读取的名称,在许多任务中使用. 举个例子. `Origami Image Service`
-   `SERVICE_SYSTEM_CODE`:此服务的系统代码,在许多任务中使用. 举个例子. `origami-image-service`
-   `SERVICE_SALESFORCE_ID`: 与此服务相關的 Salesforce ID, 用于创建发布日志
-   `HEROKU_APP_QA`: QA. E. 等的Heroku应用程序ID. `origami-image-service-qa`
-   `HEROKU_APP_EU`: Heroku 生产欧盟的应用程序ID. 举个例子. `origami-image-service-eu`
-   `HEROKU_APP_US`:美国生产的Heroku应用程序ID. 举个例子. `origami-image-service-us`
-   `EXPECTED_COVERAGE`:一个数字,表示应用程序单位测试的预期代码覆盖. 默认为 `90`
-   `INTEGRATION_TIMEOUT`:每次集成测试允许运行的时间以毫秒为单位. 默认为 `5000`
-   `INTEGRATION_SLOW`:每次集成测试都被认为是缓慢时间以毫秒为单位. 默认为 `4000`
-   `INTEGRATION_FLAGS`: 任何必须传递给 `mocha` 当进行整合测试时.
-   `REGION`:应用程序运行的区域,用于发布日志,并确定需要哪些发布任务. 一个 `QA`, (中文(简体) ), `EU`,或 `US`
-   `RELEASE_LOG_ENVIRONMENT`: 将销售力环境列入发行日志。 一个 `Test` 或者说 `Production`
-   `GRAFANA_DASHBOARD`: 用于应用程序的Grafana仪表板标识
-   `GITHUB_RELEASE_REPO`: GitHub 仓库在 `owner/name` 格式。 用于自动转换

### 私人配置

这些配置绝不能出现在您的源代码中, 因此应该设置在 CI, 或 Heroku, 或一个 `.env` 本地文件 :

-   `CMDB_API_KEY`: 用于执行CMDB 操作的 API 密钥
-   `RELEASE_LOG_API_KEY`: 更改请求创建和关闭发布日志时使用的 API 密钥
-   `GRAFANA_API_KEY`: 执行 Grafana 操作时使用的 API 密钥
-   `GITHUB_RELEASE_USER`: 使用自动转换任务在 GitHub 为寄存器创建版本的用户 。 此用户必须拥有写入权限 `GITHUB_RELEASE_REPO`
-   `GITHUB_RELEASE_TOKEN`: 一个符号 `GITHUB_RELEASE_USER` 它已经 `repo` 级别访问

## 联系人

如果您对本单元有任何问题或评论,或需要帮助使用,请 [提出问题](https://github.com/Financial-Times/origami-service-makefile/issues)访问 [#origami - 支持](https://financialtimes.slack.com/messages/origami-support/) 或电子邮件 [折纸支持](mailto:origami-support@ft.com)。 。 。 .

## 许可证

本软件由金融时报根据以下规定出版: [麻省理工学院许可证](http://opensource.org/licenses/MIT)。 。 。 .

## 常见问题

### @financial-times/origami-service-makefile 是什么？

建立和管理 " origami " 服务的共同工具

### 如何安装 @financial-times/origami-service-makefile？

在项目目录运行 npm install @financial-times/origami-service-makefile，或使用 pnpm add / yarn add / bun add。

### @financial-times/origami-service-makefile 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/financial-times\_\_origami-service-makefile 是否存在。

### @financial-times/origami-service-makefile 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @financial-times/origami-service-makefile 可以商用吗？

@financial-times/origami-service-makefile 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @financial-times/origami-service-makefile 的下载量有多少？

根据 npm 官方下载统计，@financial-times/origami-service-makefile 在 2026/10/15 – 2026/11/13 这 30 天内被下载 30,119 次，日均约 1,004 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @financial-times/origami-service-makefile 还在维护吗？

最新版本 7\.0\.3 发布于 2020/04/10（6 年前）；至今共发布 22 个版本，其中过去 12 个月发布了 0 个；首次发布于 2017/07/05。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

