LoginSignup
7
8

More than 5 years have passed since last update.

GitLab CI で複数のプロジェクトを連携する

Posted at

  • wordpress
  • my-theme
  • my-plugin

WordPressのコアとテーマを別に管理していてテーマやプラグインを更新したらコアをdeployしたい場合。

対象

GitLab 7.14
https://about.gitlab.com/2015/08/22/gitlab-7-14-released/

設定

  1. 連携先(wordpress)でTriggers→Add Trigger。Tokenが表示される。
  2. 連携元(my-theme)の.gitlab-ci.ymlを編集。 TOKENとREF_NAMEはそのまま書き換えるかVariablesを使う。
    REF_NAME=master。
    Variablesを使う場合は${TOKEN}のように書く。
trigger:
  type: deploy
  script:
    - "curl -X POST -F token=${TOKEN} http://gitlab-ci.tsuyoshioka.jp/api/v1/projects/3/refs/${REF_NAME}/trigger"

my-pluginも同じように設定。

これでmy-themeを更新してビルドが通ればwordpressも連携して再ビルドされる。

7
8
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
7
8