Buildのプロモート

Updated 2 years ago by Admin

指定されたビルド番号をターゲット環境にプロモートします (つまり、ビルド42をproductionにプロモートします)。このAPIには、リポジトリへの書き込みアクセスが必要であることに注意してください。

  • ビルドをターゲット環境にプロモートします。
    POST /api/repos/{owner}/{repo}/builds/{build}/promote?target={target}

  • カスタムパラメータを使用してビルドをプロモートします。これらのパラメーターは、パイプラインステップで環境変数として使用できます。
    POST /api/repos/{owner}/{repo}/builds/{build}/promote?target={target}&{key=value}

レスポンス本文の例:

1   {
2 "id": 100207,
3 "repo_id": 296163,
4 "number": 42,
5 "status": "pending",
6 "event": "promote",
7 "link": "https://github.com/octoat/hello-world/compare/e3320539a4c0...9fc1ad6ebf12",
8 "message": "updated README",
9 "before": "e3320539a4c03ccfda992641646deb67d8bf98f3",
10 "after": "9fc1ad6ebf12462f3f9773003e26b4c6f54a772e",
11 "ref": "refs/heads/master",
12 "source_repo": "spaceghost/hello-world",
13 "source": "master",
14 "target": "master",
15 "author_login": "octocat",
16 "author_name": "The Octocat",
17 "author_email": "octocat@github.com",
18 "author_avatar": "http://www.gravatar.com/avatar/7194e8d48fa1d2b689f99443b767316c",
19 "sender": "bradrydzewski",
20 "started": 0,
21 "finished": 0,
22 "created": 1564085874,
23 "updated": 1564085874,
24 "version": 1,
25 "stages": [
26 {
27 "id": 199937,
28 "repo_id": 296163,
29 "build_id": 100207,
30 "number": 1,
31 "name": "default",
32 "kind": "pipeline",
33 "type": "docker",
34 "status": "pending",
35 "errignore": false,
36 "exit_code": 0,
37 "machine": "15e89c0f84f1",
38 "os": "linux",
39 "arch": "amd64",
40 "started": 0,
41 "stopped": 0,
42 "created": 1564085874,
43 "updated": 1564086343,
44 "version": 1,
45 "on_success": true,
46 "on_failure": false
47 }
48 ]
49 }


How did we do?