This page contains information related to upcoming products, features, and functionality. It is important to note that the information presented is for informational purposes only. Please do not rely on this information for purchasing or planning purposes. The development, release, and timing of any products, features, or functionality may be subject to change or delay and remain at the sole discretion of GitLab Inc.
Status Authors Coach DRIs Owning Stage Created
proposed devops verify -

GitLab CI 이벤트 제안 3: .gitlab/ci/events 폴더 사용

이 제안에서는 각 이벤트 그룹마다 별도의 파일을 작성하고자 합니다. 다음과 같은 형식으로 이벤트를 정의할 수 있습니다.

# .gitlab/ci/events/package-published.yml

spec:
  events:
    - name: package/published
---
include:
  - local: .gitlab-ci.yml
    with:
      event: $[[ gitlab.event.name ]]

그리고 .gitlab-ci.yml 파일에서는 다음과 같이 입력을 사용할 수 있습니다.

# .gitlab-ci.yml

spec:
  inputs:
    event:
      default: push
---
job1:
  script: echo "Hello World"

job2:
  script: echo "Hello World"

job-for-package-published:
  script: echo "Hello World"
  rules:
    - if: $[[ inputs.event ]] == "package/published"

이벤트가 발생할 때;

  1. 우리는 해당 이벤트를 위한 새 작업을 대기열에 넣을 것입니다.
  2. 작업은 .gitlab/ci/events 폴더에서 이벤트 파일을 찾을 것입니다.
  3. 작업은 이벤트 파일에 대해 Ci::CreatePipelineService를 실행할 것입니다.

문제점 및 질문

  1. 정의된 각 이벤트 실행마다 새 작업을 대기열에 넣어야 합니다.
  2. 모든 이벤트 작업은 파일을 찾아야 합니다.
  3. 이는 프로젝트 범위의 이벤트에만 해당될 것입니다.
  4. GitLab.com 규모에서는 작동하지 않을 것입니다.