Skip Navigation
Show nav
Dev Center
  • Get Started
  • ドキュメント
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • ドキュメント
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku のアーキテクチャ
    • Dyno (アプリコンテナ)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • スタック (オペレーティングシステムイメージ)
    • ネットワーキングと DNS
    • プラットフォームポリシー
    • プラットフォームの原則
  • Developer Tools
    • コマンドライン
    • Heroku VS Code Extension
  • デプロイ
    • Git を使用したデプロイ
    • Docker によるデプロイ
    • デプロイ統合
  • 継続的デリバリーとインテグレーション
    • 継続的統合
  • 言語サポート
    • Node.js
      • Working with Node.js
      • Node.js Behavior in Heroku
      • Troubleshooting Node.js Apps
    • Ruby
      • Rails のサポート
      • Bundler の使用
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Python でのバックグランドジョブ
      • Python Behavior in Heroku
      • Django の使用
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Maven の使用
      • Spring Boot の使用
      • Troubleshooting Java Apps
    • PHP
      • PHP Behavior in Heroku
      • Working with PHP
    • Go
      • Go の依存関係管理
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • データベースとデータ管理
    • Heroku Postgres
      • Postgres の基礎
      • Postgres スターターガイド
      • Postgres のパフォーマンス
      • Postgres のデータ転送と保持
      • Postgres の可用性
      • Postgres の特別なトピック
      • Migrating to Heroku Postgres
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • その他のデータストア
  • AI
    • Working with AI
    • Heroku Inference
      • Inference API
      • Quick Start Guides
      • AI Models
      • Inference Essentials
    • Vector Database
    • Model Context Protocol
  • モニタリングとメトリクス
    • ログ記録
  • アプリのパフォーマンス
  • アドオン
    • すべてのアドオン
  • 共同作業
  • セキュリティ
    • アプリのセキュリティ
    • ID と認証
      • シングルサインオン (SSO)
    • Private Space
      • インフラストラクチャネットワーキング
    • コンプライアンス
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Team
    • Heroku Connect (Salesforce 同期)
      • Heroku Connect の管理
      • Heroku Connect のリファレンス
      • Heroku Connect のトラブルシューティング
  • パターンとベストプラクティス
  • Heroku の拡張
    • Platform API
    • アプリの Webhook
    • Heroku Labs
    • アドオンのビルド
      • アドオン開発のタスク
      • アドオン API
      • アドオンのガイドラインと要件
    • CLI プラグインのビルド
    • 開発ビルドパック
    • Dev Center
  • アカウントと請求
  • トラブルシューティングとサポート
  • Salesforce とのインテグレーション
  • Heroku の拡張
  • Platform API
  • Platform API を使用したパイプライン

Platform API を使用したパイプライン

日本語 — Switch to English

最終更新日 2022年03月09日(水)

Table of Contents

  • パイプラインの作成
  • パイプラインへのアプリの追加
  • パイプラインの検査
  • アプリが属するパイプラインの検索
  • パイプラインの検索
  • プロモーションの実行

この記事では、Platform API​ のパイプライン関連のリソースを使用して、複数のアプリの開発からステージング、さらには本番ステージへのライフサイクルを管理する方法について説明します。

パイプラインの作成

パイプラインを作成するには、パイプラインの name​ を指定して POST /pipelines​ エンドポイントを呼び出します。 それを cURL を使用して行いましょう。

$ curl -X POST -H "Accept: application/vnd.heroku+json; version=3" -n \
-H "Content-Type: application/json" \
-d '{"name": "my-pipeline"}' \
https://api.heroku.com/pipelines

これにより、名前 my-pipeline​ を持つ空のパイプラインが生成され、このレスポンスには、以降の API 呼び出しで使用する必要のあるパイプライン id​ が含まれます。

{
  "created_at": "2016-02-11T08:32:08+00:00",
  "id": "3be4b9ee-5734-4033-a4c0-28c3d5de99fe",
  "name": "my-pipeline",
  "updated_at": "2016-02-11T08:32:08+00:00"
}

パイプラインへのアプリの追加

これで最上位レベルのパイプラインが構成されたので、このパイプラインへのアプリを追加を開始できます。それを行うには、アプリの name​、パイプラインの id​、そのアプリが属する stage​ を指定して POST /pipeline-couplings​ エンドポイントを呼び出します。

$ curl -X POST -H "Accept: application/vnd.heroku+json; version=3" -n \
-H "Content-Type: application/json" \
-d '{"app": "my-app-development", "pipeline": "3be4b9ee-5734-4033-a4c0-28c3d5de99fe", "stage": "development"}' \
https://api.heroku.com/pipeline-couplings

これにより、アプリをパイプラインに結び付ける関連付けであるパイプラインカップリングが作成されます。

{
  "created_at": "2016-02-11T08:40:42+00:00",
  "app": {
    "id": "dde884b0-7610-428f-bc36-9393b1c7efb7"
  },
  "id": "ead76531-1669-4967-9953-e7182605f772",
  "pipeline": {
    "id": "3be4b9ee-5734-4033-a4c0-28c3d5de99fe",
    "name": "my-pipeline"
  },
  "stage": "development",
  "updated_at": "2016-02-11T08:40:42+00:00"
}

アプリは、同時に 1 つのパイプラインにしか属することができません。

パイプラインの検査

パイプラインにいくつかのアプリを追加したら、GET /pipelines/:id/pipeline-couplings​ エンドポイントを使用してその内容を検査できます。

$ curl -H "Accept: application/vnd.heroku+json; version=3" -n \
https://api.heroku.com/pipelines/3be4b9ee-5734-4033-a4c0-28c3d5de99fe/pipeline-couplings

このエンドポイントには、パイプライン内のすべてのパイプラインカップリングが一覧表示されます。各パイプラインカップリングには、それが関連しているアプリとステージが含まれています。

[
  {
    "created_at": "2016-02-11T08:40:42+00:00",
    "app": {
      "id": "dde884b0-7610-428f-bc36-9393b1c7efb7"
    },
    "id": "ead76531-1669-4967-9953-e7182605f772",
    "pipeline": {
      "id": "3be4b9ee-5734-4033-a4c0-28c3d5de99fe",
      "name": "my-pipeline"
    },
    "stage": "development",
    "updated_at": "2016-02-11T08:40:42+00:00"
  },
  {
    "created_at": "2016-02-11T08:45:18+00:00",
    "app": {
      "id": "d4c557ef-8a66-40fa-aa2d-e238fcabcb62"
    },
    "id": "53e3112b-1d4e-467b-9e67-ec7eab94d019",
    "pipeline": {
      "id": "3be4b9ee-5734-4033-a4c0-28c3d5de99fe",
      "name": "my-pipeline"
    },
    "stage": "staging",
    "updated_at": "2016-02-11T08:45:18+00:00"
  },
  {
    "created_at": "2016-02-11T08:45:36+00:00",
    "app": {
      "id": "e2296460-0f8c-4430-8d99-1c5ab928f453"
    },
    "id": "67a22093-bb48-426f-b1c5-3178024279bb",
    "pipeline": {
      "id": "3be4b9ee-5734-4033-a4c0-28c3d5de99fe",
      "name": "my-pipeline"
    },
    "stage": "production",
    "updated_at": "2016-02-11T08:45:36+00:00"
  }
]

アプリが属するパイプラインの検索

出発点がアプリであり、それがどのパイプラインの一部であるかを検索する場合は、GET /apps/:id_or_name/pipeline-couplings​ エンドポイントを使用できます。

$ curl -H "Accept: application/vnd.heroku+json; version=3" -n \
https://api.heroku.com/apps/my-app-staging

このレスポンスには、このアプリをパイプラインに結び付けているパイプラインカップリングが含まれます。

{
  "created_at": "2016-02-11T08:45:18+00:00",
  "app": {
    "id": "d4c557ef-8a66-40fa-aa2d-e238fcabcb62"
  },
  "id": "53e3112b-1d4e-467b-9e67-ec7eab94d019",
  "pipeline": {
    "id": "3be4b9ee-5734-4033-a4c0-28c3d5de99fe",
    "name": "my-pipeline"
  },
  "stage": "staging",
  "updated_at": "2016-02-11T08:45:18+00:00"
}

パイプラインの検索

パイプラインを構成したら、GET /pipelines​ エンドポイントを使用して、すでに存在するパイプラインを一覧表示できます。

$ curl -H "Accept: application/vnd.heroku+json; version=3" -n \
https://api.heroku.com/pipelines

このレスポンスには、アクセス可能なすべてのパイプラインが含まれます。

[
  {
    "created_at": "2016-02-11T08:32:08+00:00",
    "id": "3be4b9ee-5734-4033-a4c0-28c3d5de99fe",
    "name": "my-pipeline",
    "updated_at": "2016-02-11T08:32:08+00:00"
  }
]

パイプライン名はわかっているが、その name​ をパイプラインの id​ に解決したい場合は、GET /pipelines/:id_or_name​ エンドポイントを使用してそれを行うことができます。

$ curl -H "Accept: application/vnd.heroku+json; version=3" -n \
https://api.heroku.com/pipelines/my-pipeline

その名前が 1 つのパイプラインに解決される場合、このレスポンスは期待されるパイプライン表現になります。ただし、同じ名前を持つ複数のパイプラインにアクセスできる場合は、その呼び出しによって 300 Multiple Choices​ ステータスと、潜在的な候補の一覧を含むレスポンスが返されます。

プロモーションの実行

パイプラインがすべて設定されており、my-app-development​ アプリ内にステージングアプリにダウンストリームしたい変更がある場合は、POST /pipeline-promotions​ エンドポイントを呼び出すことによってそれを行うことができます。このエンドポイントでは、pipeline:id​、ソースアプリ (my-app-development​) の app:id​、ターゲットの app:id​ (my-app-staging​) の配列を渡す必要があります。

$ curl -X POST -H "Accept: application/vnd.heroku+json; version=3" -n \
-H "Content-Type: application/json" \
-d '{"pipeline":{"id":"3be4b9ee-5734-4033-a4c0-28c3d5de99fe"},"source":{"app":{"id":"dde884b0-7610-428f-bc36-9393b1c7efb7"}},"targets":[{"app":{"id":"d4c557ef-8a66-40fa-aa2d-e238fcabcb62"}}]}' \
https://api.heroku.com/pipeline-promotions

このエンドポイントからのレスポンスには、このプロモーションがまだ進行中か、または完了したかを示す status​ フィールドが含まれます。

{
  "created_at": "2016-02-11T09:34:05+00:00",
  "id": "14990d18-d3f0-44c0-8991-10213a1dc689",
  "pipeline": {
    "id": "3be4b9ee-5734-4033-a4c0-28c3d5de99fe"
  },
  "source": {
    "app": {
      "id": "dde884b0-7610-428f-bc36-9393b1c7efb7"
    },
    "release": {
      "id": "14654174-9f0d-4939-a1a3-188ca134828f"
    }
  },
  "status": "pending",
  "updated_at": "2016-02-11T09:34:05+00:00"
}

更新されたバージョンを取得して status​ の更新を確認するには、GET /pipeline-promotions/:id​ エンドポイントを呼び出すことができます。

パイプラインプロモーションの status​ が completed​ に収束したら、GET /pipeline-promotions/:id/promotion-targets​ を呼び出すことによって、プロモーション内の個々の対象アプリのステータスを検査できます。

$ curl -H "Accept: application/vnd.heroku+json; version=3" -n \
https://api.heroku.com/pipeline-promotions/14990d18-d3f0-44c0-8991-10213a1dc689/promotion-targets

このレスポンスには、成功したプロモーションの release:id​ と、失敗したプロモーションのケースの error_message​ が含まれます。

[
  {
    "app": {
      "id": "d4c557ef-8a66-40fa-aa2d-e238fcabcb62"
    },
    "error_message": null,
    "id": "154e5fa9-578c-4233-8f5f-6b33549c7dd1",
    "pipeline_promotion": {
      "id": "14990d18-d3f0-44c0-8991-10213a1dc689"
    },
    "release": {
      "id": "53226d94-f915-48ee-bda3-f5b1c8510009"
    },
    "status": "succeeded"
  }
]

関連カテゴリー

  • Platform API
ゼロからの slug の作成 Platform API を使用したビルドとリリース

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure
  • .NET

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2025 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices