DevEnjoy

One Step Closer

Bitbucket

Git Repository Bitbucket과 Issue Tracker Redmine 연동 설정

2019년 1월 17일 by YongPwi Leave a Comment

Instructions

  1. Redmine에서 Bitbucket 연동을 위해 Redmine Bitbucket plugin을 설치
    • Redmine Bitbucket plugin 현재 버전이 설정 저장 부분에 버그가 존재해서 수정된 plugin을 repository clone
    • 서버에 Redmine 설치 경로를 찾고 “{설치경로}/plugins” 하위에 plugin 압축해제
    • Bitbucket에서 repository 정보를 가져오기 위해 ssh key 생성
      • 일반적으로 redmine 설치를 web server에 “http-passenger” 설정을 하여 사용하고 그래서 일반 가이드들은 web server user인 ‘www-data’ 의 ssh key를 생성하라고 나옴
      • 사내는 redmine user에 ssh key를 생성하여야 연동이 가능(redmine user home : /data/redmine/)
        1
        sudo -u redmine ssh-keygen -t rsa
      • 생성된 공개키(id_rsa.pub)를 Bitbucket ssh key로 등록(개인 계정보단 관리 계정에 등록 추천) 계정에 등록

    • Plugin 설치를 위해선 명령어 입력 필요
      1. 설치

        1
        rake redmine:plugins NAME=redmine_bitbucket RAILS_ENV=production
      2. 삭제(나중을 위해)

        1
        rake redmine:plugins:migrate NAME=redmine_bitbucket VERSION=0 RAILS_ENV=production
    • plugin 설치 확인을 위해 redmine admin 계정으로 로그인하고 “관리 > Plugin” 페이지로 이동
      • 플러그인 “설정” 페이지로 이동

        설정 값 확인 및 Local repositories path 확인, 여기 설정된 경로 하위로 Bitbucket Repository에서 event가 발생하면 복사

      • 서버에 redmine 설치 경로 하위에 redmine admin page에서 설정한 Local repositories path 값의 폴더 경로 맞춰야함
        “{설치경로}/bitbucket_repos“
    • redmine 프로젝트 확인
      1. redmine 프로젝트 설정 정보 하위 “식별자” 정보 확인(id)

        상위 “식별자” 값이 Bitbucket Webhooks 설정에서 url 값으로 사용

  2. Bitbucket 설정
    1. Setting > SSH Keys 페이지에서 redmine 계정으로 생성한 공개키 등록
    2. Redmine Project와 연결하려는 Bitbucket Repository의 “설정 > Webhooks” 페이지  이동

      등록된 URL 정보는 Redmine 연동에 꼭 필요한 설정 정보

      https://{redmine url 주소}/hooks/bitbucket/{id}

      redmine url : 운영 혹은 사용 예정인 url
      id : redmine project 식별자 값

      세부적으로 git event 별로 redmine 연동 가능 해당 부분은 따로 찾아보길 바람

  3. Redmine Project 설정
    1. redmine project 설정 > 저장소 페이지

      주 저장소를 선택해야 commit 메세지에서 “참조”, “해결” 의 상태 업데이트가 가능하다.

      저장소 경로는 plugin 설정 페이지에서 설정한 Local repositories path 하위 정보 추가

      bitbucket_repos/{Bitbucket User}/{Bitbucket Repository Name}/{식별자}/

  4. Bitbucket Commit Message 연동
    1. Bitbucket Commit Message 연동을 위해 redmine 관리자 계정으로 “로그인 > 관리 > 설정 > 저장소” 페이지 이동
    2. 참조
      1. commit message 작성시 Project 내 이슈 id와 참조 연결
      2. 참조 명령어 설정은 “로그인 > 관리 > 설정 > 저장소” 페이지 내 “일감 참조에 사용할 키워드들” 입력값으로 연동 가능
        1. redmine 기본 설정(for referencing issues) : refs, references, IssueID
        2. ex : This commit refs #1, #4 and fixes #4
        3. 상위 commit message에 refs #1, #4 부분을 인식하여 해당 repository와 연결된 redmine project 내 1번, 4번 이슈 페이지에 commit 관련 내용이 추가
    3. 완료(해결)
      1. commit message 작성시 Project 내 이슈 id와 완료 연결
      2. 참조 명령어 설정은 “로그인 > 관리 > 설정 > 저장소” 페이지 내 “일감 해결에 사용할 키워드들” 입력값으로 연동 가능
      3. 키워드들에 해당하는 commit message가 들어오면 설정한 “적용된 상태” 값으로 입력한 id 값의 이슈 id의 상태값이 변경
        1. ex : This commit refs #1, #4 and fixes #4
        2. 상위 commit message에 fixes #4 부분을 인식하여 해당 repository와 연결된 redmine project 내 4번 이슈 페이지의 상태값이 변경
  5. Redmine 내 wiki 마크다운 관련 자료
    1. https://www.redmine.org/projects/redmine/wiki/RedmineTextFormattingTextile
    2. commit message 이외 일반 글 작성시 commit link 가능
      1. commit 링크 연동 테스트 – commit:4a5becde
  6. Bitbucket webhook white list 추가

    1. redmine 운영을 내부망에서만 사용하기 때문에 cloud 기반 bitbucket을 사용하는 경우 사용 IP를 방화벽에 추가해줘야 한다.
    2. https://confluence.atlassian.com/bitbucket/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall-343343385.html
Posted in: Atlassian, Bitbucket, Programing, Redmine Tagged: bitbucket, git, redmine

Calendar

6월 2025
일 월 화 수 목 금 토
« 4월    
1234567
891011121314
15161718192021
22232425262728
2930  

Recent Posts

  • ubuntu bastion 설정
  • Spring Boot properties 암호화
  • Git Repository Bitbucket과 Issue Tracker Redmine 연동 설정
  • Spring Security 동일 session 제어
  • Spring @Mock, @Mockbean, @InjectMock

Recent Comments

  • pzotov (Ubuntu 14.04에서 Sonarqube 6.7.1 service 등록)
  • cours de theatre paris (AWS ELB와 Auto Scaling 연동, nginx)
  • bayern munich (IntelliJ EAP Font rendering)
  • camiseta del chelsea (OS X에서 APP 아이콘 변경)
  • cheap football shirts replica (jQuery Ajax에서 json Array 직렬화)

Copyright © [the-year] [site-link].

Powered by [wp-link] and [theme-link].