- 파이프라인 페이지네이션
 - 프로젝트 파이프라인 디렉터리
 - 단일 파이프라인 얻기
 - 가장 최근 파이프라인 가져오기
 - 새로운 파이프라인 생성
 - 파이프라인 작업 다시 시도
 - 파이프라인 작업 취소
 - 파이프라인 삭제
 - 파이프라인 메타데이터 업데이트
 
파이프라인 API
Tier: Free, Premium, Ultimate
Offering: GitLab.com, Self-managed, GitLab Dedicated
파이프라인 페이지네이션
기본적으로 GET 요청은 API 결과를 페이지별로 20개씩 반환합니다.
자세한 내용은 페이지네이션을 참조하십시오.
프로젝트 파이프라인 디렉터리
- 응답의
 iid는 GitLab 14.6에서 도입되었습니다.- 응답의
 name은 GitLab 15.11에서 도입되었습니다, 기본적으로는 비활성화된pipeline_name_in_api라는 플래그와 함께.- 요청의
 name은 GitLab 15.11에서 도입되었습니다, 기본적으로는 비활성화된pipeline_name_search라는 플래그와 함께.- 응답의
 name은 GitLab 16.3에서 일반적으로 이용 가능해졌습니다. 피처 플래그pipeline_name_in_api가 제거되었습니다.- 요청의
 name은 GitLab 16.9에서 일반적으로 이용 가능해졌습니다. 피처 플래그pipeline_name_search가 제거되었습니다.
프로젝트 내 파이프라인을 나열합니다. 하위 파이프라인은 결과에 포함되지 않지만, 개별적으로 하위 파이프라인을 얻을 수 있습니다.
GET /projects/:id/pipelines
| 속성 | 유형 | 필수 | 설명 | 
|---|---|---|---|
id
 | 숫자/문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로 | 
name
 | 문자열 | 아니오 | 지정된 이름의 파이프라인을 반환합니다. | 
order_by
 | 문자열 | 아니오 | 파이프라인을 id, status, ref, updated_at 또는 user_id로 정렬합니다 (기본값: id)
 | 
ref
 | 문자열 | 아니오 | 파이프라인의 ref | 
scope
 | 문자열 | 아니오 | 파이프라인의 범위 중 하나, running, pending, finished, branches, tags 중 하나
 | 
sha
 | 문자열 | 아니오 | 파이프라인의 SHA | 
sort
 | 문자열 | 아니오 | 파이프라인을 asc 또는 desc 순서로 정렬합니다 (기본값: desc)
 | 
source
 | 문자열 | 아니오 | 
GitLab 14.3 이상에서 파이프라인이 트리거된 방법 중 하나, api, chat, external, external_pull_request_event, merge_request_event, ondemand_dast_scan, ondemand_dast_validation, parent_pipeline, pipeline, push, schedule, security_orchestration_policy, trigger, web, 또는 webide 중 하나
 | 
status
 | 문자열 | 아니오 | 파이프라인의 상태 중 하나, created, waiting_for_resource, preparing, pending, running, success, failed, canceled, skipped, manual, scheduled 중 하나
 | 
updated_after
 | 날짜 및 시간 | 아니오 | 지정된 날짜 이후에 업데이트된 파이프라인을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z)으로 입력하세요.
 | 
updated_before
 | 날짜 및 시간 | 아니오 | 지정된 날짜 전에 업데이트된 파이프라인을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z)으로 입력하세요.
 | 
username
 | 문자열 | 아니오 | 파이프라인을 트리거한 사용자의 사용자 이름 | 
yaml_errors
 | 부울 | 아니오 | 유효하지 않은 구성으로 설정된 파이프라인을 반환합니다. | 
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines"
응답 예시
[
  {
    "id": 47,
    "iid": 12,
    "project_id": 1,
    "status": "pending",
    "source": "push",
    "ref": "new-pipeline",
    "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
    "name": "Build pipeline",
    "web_url": "https://example.com/foo/bar/pipelines/47",
    "created_at": "2016-08-11T11:28:34.085Z",
    "updated_at": "2016-08-11T11:32:35.169Z"
  },
  {
    "id": 48,
    "iid": 13,
    "project_id": 1,
    "status": "pending",
    "source": "web",
    "ref": "new-pipeline",
    "sha": "eb94b618fb5865b26e80fdd8ae531b7a63ad851a",
    "name": "Build pipeline",
    "web_url": "https://example.com/foo/bar/pipelines/48",
    "created_at": "2016-08-12T10:06:04.561Z",
    "updated_at": "2016-08-12T10:09:56.223Z"
  }
]
단일 파이프라인 얻기
- 응답의
 iid는 GitLab 14.6에서 도입되었습니다.- 응답의
 name은 GitLab 15.11에서 도입되었습니다, 기본적으로는 비활성화된pipeline_name_in_api라는 플래그와 함께.- 응답의
 name은 GitLab 16.3에서 일반적으로 이용 가능해졌습니다. 피처 플래그pipeline_name_in_api가 제거되었습니다.
프로젝트에서 하나의 파이프라인을 가져옵니다.
또한 단일 하위 파이프라인도 가져올 수 있습니다.
GET /projects/:id/pipelines/:pipeline_id
| 속성 | 유형 | 필수 | 설명 | 
|---|---|---|---|
id
 | 숫자/문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로 | 
pipeline_id
 | 숫자 | 예 | 파이프라인의 ID | 
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/46"
응답 예시
{
  "id": 46,
  "iid": 11,
  "project_id": 1,
  "name": "Build pipeline",
  "status": "success",
  "ref": "main",
  "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
  "before_sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
  "tag": false,
  "yaml_errors": null,
  "user": {
    "name": "Administrator",
    "username": "root",
    "id": 1,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
    "web_url": "http://localhost:3000/root"
  },
  "created_at": "2016-08-11T11:28:34.085Z",
  "updated_at": "2016-08-11T11:32:35.169Z",
  "started_at": null,
  "finished_at": "2016-08-11T11:32:35.145Z",
  "committed_at": null,
  "duration": 123.65,
  "queued_duration": 0.010,
  "coverage": "30.0",
  "web_url": "https://example.com/foo/bar/pipelines/46"
}
파이프라인의 변수 가져오기
GET /projects/:id/pipelines/:pipeline_id/variables
| 속성 | 유형 | 필수 | 설명 | 
|---|---|---|---|
id
 | 정수/문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 된 경로 | 
pipeline_id
 | 정수 | 예 | 파이프라인의 ID | 
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/46/variables"
응답 예시
[
  {
    "key": "RUN_NIGHTLY_BUILD",
    "variable_type": "env_var",
    "value": "true"
  },
  {
    "key": "foo",
    "value": "bar"
  }
]
파이프라인의 테스트 보고서 가져오기
이 API 경로는 단위 테스트 보고서 기능의 일부입니다.
GET /projects/:id/pipelines/:pipeline_id/test_report
| 속성 | 유형 | 필수 | 설명 | 
|---|---|---|---|
id
 | 정수/문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 된 경로 | 
pipeline_id
 | 정수 | 예 | 파이프라인의 ID | 
샘플 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/46/test_report"
응답 예시:
{
  "total_time": 5,
  "total_count": 1,
  "success_count": 1,
  "failed_count": 0,
  "skipped_count": 0,
  "error_count": 0,
  "test_suites": [
    {
      "name": "Secure",
      "total_time": 5,
      "total_count": 1,
      "success_count": 1,
      "failed_count": 0,
      "skipped_count": 0,
      "error_count": 0,
      "test_cases": [
        {
          "status": "success",
          "name": "Security Reports can create an auto-remediation MR",
          "classname": "vulnerability_management_spec",
          "execution_time": 5,
          "system_output": null,
          "stack_trace": null
        }
      ]
    }
  ]
}
파이프라인의 테스트 보고서 요약 가져오기
- GitLab 14.2에서 도입됨.
 
이 API 경로는 단위 테스트 보고서 기능의 일부입니다.
GET /projects/:id/pipelines/:pipeline_id/test_report_summary
| 속성 | 유형 | 필수 | 설명 | 
|---|---|---|---|
id
 | 정수/문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 된 경로 | 
pipeline_id
 | 정수 | 예 | 파이프라인의 ID | 
샘플 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/46/test_report_summary"
응답 예시:
{
    "total": {
        "time": 1904,
        "count": 3363,
        "success": 3351,
        "failed": 0,
        "skipped": 12,
        "error": 0,
        "suite_error": null
    },
    "test_suites": [
        {
            "name": "test",
            "total_time": 1904,
            "total_count": 3363,
            "success_count": 3351,
            "failed_count": 0,
            "skipped_count": 12,
            "error_count": 0,
            "build_ids": [
                66004
            ],
            "suite_error": null
        }
    ]
}
가장 최근 파이프라인 가져오기
- 응답의
 name은 GitLab 15.11에서 도입됨 (기본적으로 비활성화된pipeline_name_in_api라는 피처 플래그와 함께) .- 응답의
 name은 GitLab 16.3에서 일반적으로 사용 가능 합니다.pipeline_name_in_api피처 플래그가 제거되었습니다.
특정 ref에서 가장 최근 커밋에 대한 최신 파이프라인을 가져옵니다. 커밋에 대한 파이프라인이 없으면 403 상태 코드가 반환됩니다.
GET /projects/:id/pipelines/latest
| 속성 | 유형 | 필수 | 설명 | 
|---|---|---|---|
ref
 | 문자열 | 아니오 | 최신 파이프라인을 확인할 브랜치 또는 태그. 지정되지 않으면 기본 브랜치로 기본 설정됩니다. | 
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/latest"
응답의 예시
{
    "id": 287,
    "iid": 144,
    "project_id": 21,
    "name": "Build pipeline",
    "sha": "50f0acb76a40e34a4ff304f7347dcc6587da8a14",
    "ref": "main",
    "status": "success",
    "source": "push",
    "created_at": "2022-09-21T01:05:07.200Z",
    "updated_at": "2022-09-21T01:05:50.185Z",
    "web_url": "http://127.0.0.1:3000/test-group/test-project/-/pipelines/287",
    "before_sha": "8a24fb3c5877a6d0b611ca41fc86edc174593e2b",
    "tag": false,
    "yaml_errors": null,
    "user": {
        "id": 1,
        "username": "root",
        "name": "Administrator",
        "state": "active",
        "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
        "web_url": "http://127.0.0.1:3000/root"
    },
    "started_at": "2022-09-21T01:05:14.197Z",
    "finished_at": "2022-09-21T01:05:50.175Z",
    "committed_at": null,
    "duration": 34,
    "queued_duration": 6,
    "coverage": null,
    "detailed_status": {
        "icon": "status_success",
        "text": "passed",
        "label": "passed",
        "group": "success",
        "tooltip": "passed",
        "has_details": false,
        "details_path": "/test-group/test-project/-/pipelines/287",
        "illustration": null,
        "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png"
    }
}
새로운 파이프라인 생성
iidin response는 GitLab 14.6에서 소개되었습니다.
POST /projects/:id/pipeline
| 속성 | 타입 | 필수 여부 | 설명 | 
|---|---|---|---|
id
 | integer/string | Yes | 프로젝트의 ID 또는 URL-encoded path | 
ref
 | string | Yes | 파이프라인을 실행할 브랜치 또는 태그 | 
variables
 | array | No | 파이프라인에서 사용 가능한 변수를 포함하는 해시 배열 ([{ 'key': 'UPLOAD_TO_S3', 'variable_type': 'file', 'value': 'true' }, {'key': 'TEST', 'value': 'test variable'}])
 | 
만약 variable_type가 제외되면 env_var로 기본 설정됩니다.
 | 
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipeline?ref=main"
응답 예시
{
  "id": 61,
  "iid": 21,
  "project_id": 1,
  "sha": "384c444e840a515b23f21915ee5766b87068a70d",
  "ref": "main",
  "status": "pending",
  "before_sha": "0000000000000000000000000000000000000000",
  "tag": false,
  "yaml_errors": null,
  "user": {
    "name": "Administrator",
    "username": "root",
    "id": 1,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
    "web_url": "http://localhost:3000/root"
  },
  "created_at": "2016-11-04T09:36:13.747Z",
  "updated_at": "2016-11-04T09:36:13.977Z",
  "started_at": null,
  "finished_at": null,
  "committed_at": null,
  "duration": null,
  "queued_duration": 0.010,
  "coverage": null,
  "web_url": "https://example.com/foo/bar/pipelines/61"
}
파이프라인 작업 다시 시도
iidin response는 GitLab 14.6에서 소개되었습니다.
POST /projects/:id/pipelines/:pipeline_id/retry
| 속성 | 타입 | 필수 여부 | 설명 | 
|---|---|---|---|
id
 | integer/string | Yes | 프로젝트의 ID 또는 URL-encoded path | 
pipeline_id
 | integer | Yes | 파이프라인의 ID | 
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/46/retry"
응답:
{
  "id": 46,
  "iid": 11,
  "project_id": 1,
  "status": "pending",
  "ref": "main",
  "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
  "before_sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
  "tag": false,
  "yaml_errors": null,
  "user": {
    "name": "Administrator",
    "username": "root",
    "id": 1,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
    "web_url": "http://localhost:3000/root"
  },
  "created_at": "2016-08-11T11:28:34.085Z",
  "updated_at": "2016-08-11T11:32:35.169Z",
  "started_at": null,
  "finished_at": "2016-08-11T11:32:35.145Z",
  "committed_at": null,
  "duration": null,
  "queued_duration": 0.010,
  "coverage": null,
  "web_url": "https://example.com/foo/bar/pipelines/46"
}
파이프라인 작업 취소
POST /projects/:id/pipelines/:pipeline_id/cancel
| 속성 | 타입 | 필수 여부 | 설명 | 
|---|---|---|---|
id
 | integer/string | Yes | 프로젝트의 ID 또는 URL-encoded path | 
pipeline_id
 | integer | Yes | 파이프라인의 ID | 
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/46/cancel"
응답:
{
  "id": 46,
  "iid": 11,
  "project_id": 1,
  "status": "canceled",
  "ref": "main",
  "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
  "before_sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
  "tag": false,
  "yaml_errors": null,
  "user": {
    "name": "Administrator",
    "username": "root",
    "id": 1,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
    "web_url": "http://localhost:3000/root"
  },
  "created_at": "2016-08-11T11:28:34.085Z",
  "updated_at": "2016-08-11T11:32:35.169Z",
  "started_at": null,
  "finished_at": "2016-08-11T11:32:35.145Z",
  "committed_at": null,
  "duration": null,
  "queued_duration": 0.010,
  "coverage": null,
  "web_url": "https://example.com/foo/bar/pipelines/46"
}
파이프라인 삭제
파이프라인을 삭제하면 모든 파이프라인 캐시가 만료되고, 빌드, 로그, 아티팩트 및 트리거와 같이 즉시 관련된 모든 객체가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.
파이프라인을 삭제해도 하위 파이프라인은 자동으로 삭제되지 않습니다. 자세한 내용은 관련 이슈를 참조하세요.
DELETE /projects/:id/pipelines/:pipeline_id
| 속성 | 유형 | 필수여부 | 설명 | 
|---|---|---|---|
id
 | integer/string | Yes | 프로젝트의 ID 또는 URL 인코딩된 경로 | 
pipeline_id
 | integer | Yes | 파이프라인의 ID | 
curl --header "PRIVATE-TOKEN: <your_access_token>" --request "DELETE" "https://gitlab.example.com/api/v4/projects/1/pipelines/46"
파이프라인 메타데이터 업데이트
파이프라인의 메타데이터를 업데이트할 수 있습니다. 메타데이터에는 파이프라인의 이름이 포함됩니다.
PUT /projects/:id/pipelines/:pipeline_id/metadata
| 속성 | 유형 | 필수여부 | 설명 | 
|---|---|---|---|
id
 | integer/string | Yes | 프로젝트의 ID 또는 URL 인코딩된 경로 | 
name
 | string | Yes | 파이프라인의 새로운 이름 | 
pipeline_id
 | integer | Yes | 파이프라인의 ID | 
샘플 요청:
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --data "name=새로운 파이프라인 이름" "https://gitlab.example.com/api/v4/projects/1/pipelines/46/metadata"
샘플 응답:
{
  "id": 46,
  "iid": 11,
  "project_id": 1,
  "status": "running",
  "ref": "main",
  "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
  "before_sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
  "tag": false,
  "yaml_errors": null,
  "user": {
    "name": "Administrator",
    "username": "root",
    "id": 1,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
    "web_url": "http://localhost:3000/root"
  },
  "created_at": "2016-08-11T11:28:34.085Z",
  "updated_at": "2016-08-11T11:32:35.169Z",
  "started_at": null,
  "finished_at": "2016-08-11T11:32:35.145Z",
  "committed_at": null,
  "duration": null,
  "queued_duration": 0.010,
  "coverage": null,
  "web_url": "https://example.com/foo/bar/pipelines/46",
  "name": "새로운 파이프라인 이름"
}
도움말