Skip to content

Instantly share code, notes, and snippets.

@t-oginogin
Last active December 22, 2015 21:19
Show Gist options
  • Save t-oginogin/6532840 to your computer and use it in GitHub Desktop.
Save t-oginogin/6532840 to your computer and use it in GitHub Desktop.

GitLabとRedmine連携

(git@localhost:test/sample.gitを連携させる例)

1.GitLabのプロジェクトのメンバーにredmineユーザーをReporterとして追加  (GitLab上にredmineユーザーは作成済み)

2.ミラーリポジトリを作成

$ cd /home/redmine/git_repositories
$ sudo -u redmine git clone --mirror git@localhost:test/sample.git

3.Redmineのプロジェクト設定のリポジトリに登録(ローカルパスを指定)

 リポジトリ:/home/redmine/git_repositories/sample.git/

4.GitLab上のWebHooksに登録し、commitのタイミングでミラーリポジトリを更新させる。

 http://localhost:3000/github_hook?project_id=sample-project

GitLabとJenkins連携

(git@localhost:test/sample.gitを連携させる例)

1.GitLabのプロジェクトのメンバーにjenkinsユーザーをReporterとして追加  (GitLab上にjenkinsユーザーは作成済み)

2.新ジョブ登録

  • ソースコード管理:Git
  • Repository URL:git@localhost:test/sample.git
  • ビルド・トリガ:SCMをポーリング

3.GitLab上のWebHooksに登録し、commitのタイミングでジョブ実行させる。

 http://localhost:8080/git/notifyCommit?url=git@localhost:test/sample.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment