LoginSignup
3
1

More than 5 years have passed since last update.

Travis CIっぽいマトリクステストをする「Jenkins Yaml Axis Plugin」

Posted at

Jenkins Yaml Axis Pluginとは?

Travis CIみたいにyamlファイルからマトリックステストの軸を作成するためのプラグインです

使い方

1. リポジトリにyamlファイルをコミット

axis.yml
RUBY_VERSION:
  - 2.1.8
  - 2.2.4
  - 2.3.0

DATABASE:
  - mysql
  - postgres
  - oracle

2. 「マルチ構成プロジェクトのビルド」を作成

image

2. 「軸の設定」でYaml Axisを選択し、軸を設定

image

3. 実際にビルドするとyamlの値で軸が作られる

20160108011202.png

4. 特定の組み合わせのみ除外したい

Yaml matrix execution strategyを選択するとYamlで除外設定ができます

image

axis.yml
exclude:
  - RUBY_VERSION: 2.1.8
  - RUBY_VERSION: 2.3.0
    DATABASE: oracle

この例だと RUBY_VERSION == "2.1.8" OR RUBY_VERSION == "2.3.0" && DATABASE == "oracle" のような条件で除外されます。

メリット

  • 軸の設定をリポジトリに含めることができる
  • 1つのジョブでブランチごとにビルドする内容を変える事ができる
    • 例えば、Rails 5対応ブランチのみRails 5でビルドというパターン
  • 除外設定はワンライナー 1 に比べて柔軟に設定できる
    • 単純な設定ならいいけど条件が2つ以上になったら厳しい

image

詳しいこと

Jenkinsを使った最高のマトリックステスト(2016年版) - くりにっき


  1. Groovy式を入力してtrueになった時に実行される 

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1