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イベント Proposal 4: サブスクリプションを専用の設定ファイルで定義する方法

各プロジェクトは、イベントへのサブスクリプションを定義するための独自の設定ファイルを持つことができます。例えば、.gitlab-ci-event.yml 。このファイルでは、以下のフォーマットでイベントを定義できます:

events:
  - package/published
  - issue/created

このファイルがプロジェクトリポジトリで変更されると、解析され、イベントが作成、更新、削除されます。これは、パイプラインの作成を毎回追跡する必要がないことを除けば、提案1とよく似ています。

  1. .gitlab-ci-event.yml が更新されると、イベントをデータベースにアップサートします。
  2. パイプラインをトリガーするために、コード内でイベントに対するインラインリアクションを作成します。

ジョブのフィルタリング

rules キーワードを使ってジョブをフィルタリングできます。例えば

test_package_published:
  script: echo testing published package
  rules:
    - events: ["package/published"]

test_package_removed:
  script: echo testing removed package
  rules:
    - events: ["package/removed"]

そうでなければ、CI変数のどちらかで動作させることができます;

test_package_published:
  script: echo testing published package
  rules:
    - if: $CI_EVENT == "package/published"

test_package_removed:
  script: echo testing removed package
  rules:
    - if: $CI_EVENT == "package/removed"

または、提案3のような入力にすることもできます:

spec:
  inputs:
    event:
      default: push

---

test_package_published:
  script: echo testing published package
  rules:
    - if: $[[ inputs.event ]] == "package/published"

test_package_removed:
  script: echo testing removed package
  rules:
    - if: $[[ inputs.event ]] == "package/removed"

課題

  1. GitLab.comのスケールでは動作しません。