@financial-times/origami-service-makefile

中文文档
7.0.3发布于 2020/04/10MITCommonJS零依赖近 30 天下载 3万

Common tools for building and running Origami services

原始使用文档
文档目录7 节
  1. Table Of Contents
  2. Usage
  3. Configuration
  4. Safe Configurations
  5. Private Configurations
  6. Contact
  7. Licence

Origami Service Makefile

Common tools for building and running Origami services.

NPM version Build status MIT licensed

Table Of Contents

Usage

Origami Service Makefile provides a set of common tools that are required for building and running Origami services. To use the Makefile, copy the boilerplate.mk file to the root of your repo and name it Makefile:

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

Now install this module and save it to your package.json file:

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

You should now be able to run the following commands:

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

Configuration

The Origami Service Makefile can be configured with [environment variables] either in an extending Makefiles or externally. Some configurations are required to never be committed for security reasons, these have been separated below.

Safe Configurations

These configurations are safe to include in your extending Makefile, and should be kept there to avoid repetition of their values:

  • SERVICE_NAME: The human readable name for this service, used in many of the tasks. E.g. Origami Image Service
  • SERVICE_SYSTEM_CODE: The system code for this service, used in many of the tasks. E.g. origami-image-service
  • SERVICE_SALESFORCE_ID: The Salesforce ID associated with this service, used to create release logs
  • HEROKU_APP_QA: The Heroku application ID for QA. E.g. origami-image-service-qa
  • HEROKU_APP_EU: The Heroku application ID for production EU. E.g. origami-image-service-eu
  • HEROKU_APP_US: The Heroku application ID for production US. E.g. origami-image-service-us
  • EXPECTED_COVERAGE: A number indicating the expected code coverage of the application's unit tests. Defaults to 90
  • INTEGRATION_TIMEOUT: The time in milliseconds that each integration test is allowed to run for. Defaults to 5000
  • INTEGRATION_SLOW: The time in milliseconds at which each integration test is considered slow. Defaults to 4000
  • INTEGRATION_FLAGS: Any additional flags that must be passed to mocha when running the integration tests.
  • REGION: The region the application is running in, used in release logs and determining which release tasks are required. One of QA, EU, or US
  • RELEASE_LOG_ENVIRONMENT: The Salesforce environment to include in release logs. One of Test or Production
  • GRAFANA_DASHBOARD: The Grafana dashboard ID for the application
  • GITHUB_RELEASE_REPO: The GitHub repository in owner/name format. This is used for auto-versioning

Private Configurations

These configurations must never appear in your source code, and so should be set in CI, or Heroku, or an .env file locally:

  • CMDB_API_KEY: The API key to use when performing CMDB operations
  • RELEASE_LOG_API_KEY: The change request API key to use when creating and closing release logs
  • GRAFANA_API_KEY: The API key to use when performing Grafana operations
  • GITHUB_RELEASE_USER: The user who will create releases on GitHub for repositories which use the auto-version task. This user must have write access to GITHUB_RELEASE_REPO
  • GITHUB_RELEASE_TOKEN: A token for GITHUB_RELEASE_USER which has repo level access

Contact

If you have any questions or comments about this module, or need help using it, please either raise an issue, visit #origami-support or email Origami Support.

Licence

This software is published by the Financial Times under the MIT licence.

版本与发布记录

@financial-times/origami-service-makefile 共发布 22 个版本,首次发布于 2017/07/05;过去 12 个月发布了 0 个版本。

版本发布日期距今
7.0.3latest2020/04/106 年前
7.0.22020/03/256 年前
7.0.12020/03/186 年前
7.0.02019/04/117 年前
6.4.02018/11/227 年前
6.3.02018/11/217 年前

关于 @financial-times/origami-service-makefile 的常见问题

@financial-times/origami-service-makefile 是什么?

Common tools for building and running Origami services

如何安装 @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 和提交记录判断。