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. As with all projects, the items mentioned on this page are subject to change or delay. The development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.
StatusAuthorsCoachDRIsOwning StageCreated
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のスケールには使えません。