From db3d4f7d8688b3ac3c8cc89aaf4cb0dcff2e9586 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Thu, 14 Aug 2014 21:37:34 +0530 Subject: [PATCH 1/2] added support for redmine issue tracker --- Changelog.md | 1 + README.md | 13 +++++++++++++ assets/config/gitlabhq/gitlab.yml | 10 +++++----- assets/init | 14 ++++++++++++++ 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/Changelog.md b/Changelog.md index 51a21cb4..a6dffbeb 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,7 @@ # Changelog **latest** +- added support for redmine issue tracker - update to gitlab-shell 1.9.7 - update to the sameersbn/ubuntu:14.04.20140812 baseimage diff --git a/README.md b/README.md index 3fb3ed8a..6644d275 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ - [Installing Trusted SSL Server Certificates](#installing-trusted-ssl-server-certificates) - [Putting it all together](#putting-it-all-together) - [Run under sub URI](#run-under-sub-uri) + - [External Issue Trackers](#external-issue-trackers) + - [Redmine](#redmine) - [Available Configuration Parameters](#available-configuration-parameters) - [Maintenance](#maintenance) - [Creating Backups](#creating-backups) @@ -624,6 +626,16 @@ docker run --name=gitlab -d \ When you change the sub URI path, you need to recompile all precompiled assets. This can be done with either deleting tmp/cache/VERSION file under data store, or just `rm -Rf /PATH/TO/DATA_STORE/tmp`. After cleaning up cache files, restart the container. +### External Issue Trackers + +GitLab can be configured to use third party issue trackers such as Redmine. Use of third party issue trackers have to be configured on a per project basis from the project settings page. This means that the GitLab's issue tracker is always the default tracker unless specified otherwise. + +#### Redmine + +Support for issue tracking using Redmine can be added by specifying the complete URL of the Redmine web server in the `REDMINE_URL` configuration option. + +For example, if your Redmine server is accessible at `https://redmine.example.com`, then adding `-e 'REDMINE_URL=https://redmine.example.com'` to the docker run command enables Redmine support in GitLab + ### Available Configuration Parameters *Please refer the docker run command options for the `--env-file` flag where you can specify all required environment variables in a single file. This will save you from writing a potentially long docker run command.* @@ -679,6 +691,7 @@ Below is the complete list of available options that can be used to customize yo - **LDAP_ALLOW_USERNAME_OR_EMAIL_LOGIN**: If enabled, GitLab will ignore everything after the first '@' in the LDAP username submitted by the user on login. Defaults to false if LDAP_UID is userPrincipalName, else true. - **LDAP_BASE**: Base where we can search for users. No default. - **LDAP_USER_FILTER**: Filter LDAP users. No default. +- **REDMINE_URL**: Location of the redmine server, e.g. `-e 'REDMINE_URL=https://redmine.example.com'`. No defaults. # Maintenance diff --git a/assets/config/gitlabhq/gitlab.yml b/assets/config/gitlabhq/gitlab.yml index 0d4cd52e..c73458e4 100644 --- a/assets/config/gitlabhq/gitlab.yml +++ b/assets/config/gitlabhq/gitlab.yml @@ -84,26 +84,26 @@ production: &base ## External issues trackers issues_tracker: - # redmine: - # title: "Redmine" + redmine: + title: "Redmine" # ## If not nil, link 'Issues' on project page will be replaced with this # ## Use placeholders: # ## :project_id - GitLab project identifier # ## :issues_tracker_id - Project Name or Id in external issue tracker - # project_url: "http://redmine.sample/projects/:issues_tracker_id" + project_url: "{{REDMINE_URL}}/projects/:issues_tracker_id" # # ## If not nil, links from /#\d/ entities from commit messages will replaced with this # ## Use placeholders: # ## :project_id - GitLab project identifier # ## :issues_tracker_id - Project Name or Id in external issue tracker # ## :id - Issue id (from commit messages) - # issues_url: "http://redmine.sample/issues/:id" + issues_url: "{{REDMINE_URL}}/issues/:id" # # ## If not nil, links to creating new issues will be replaced with this # ## Use placeholders: # ## :project_id - GitLab project identifier # ## :issues_tracker_id - Project Name or Id in external issue tracker - # new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new" + new_issue_url: "{{REDMINE_URL}}/projects/:issues_tracker_id/issues/new" # # jira: # title: "Atlassian Jira" diff --git a/assets/init b/assets/init index dc06c07b..f326c803 100755 --- a/assets/init +++ b/assets/init @@ -69,6 +69,8 @@ LDAP_ALLOW_USERNAME_OR_EMAIL_LOGIN=${LDAP_ALLOW_USERNAME_OR_EMAIL_LOGIN:-} LDAP_BASE=${LDAP_BASE:-} LDAP_USER_FILTER=${LDAP_USER_FILTER:-} +REDMINE_URL=${REDMINE_URL:-} + # is a redis container linked? if [ -n "${REDISIO_PORT_6379_TCP_ADDR}" ]; then REDIS_HOST=${REDIS_HOST:-${REDISIO_PORT_6379_TCP_ADDR}} @@ -389,6 +391,18 @@ sudo -u git -H sed 's/{{LDAP_ALLOW_USERNAME_OR_EMAIL_LOGIN}}/'"${LDAP_ALLOW_USER sudo -u git -H sed 's/{{LDAP_BASE}}/'"${LDAP_BASE}"'/' -i /home/git/gitlab/config/gitlab.yml sudo -u git -H sed 's/{{LDAP_USER_FILTER}}/'"${LDAP_USER_FILTER}"'/' -i /home/git/gitlab/config/gitlab.yml +# apply redmine configuration +if [ -n "${REDMINE_URL}" ]; then + sudo -u git -H sed 's,{{REDMINE_URL}},'"${REDMINE_URL}"',g' -i /home/git/gitlab/config/gitlab.yml +else + # remove the redmine configuration block + sudo -u git -H sed '/redmine:/d' -i /home/git/gitlab/config/gitlab.yml + sudo -u git -H sed '/title: "Redmine"/d' -i /home/git/gitlab/config/gitlab.yml + sudo -u git -H sed '/project_url: "{{REDMINE_URL}}/d' -i /home/git/gitlab/config/gitlab.yml + sudo -u git -H sed '/issues_url: "{{REDMINE_URL}}/d' -i /home/git/gitlab/config/gitlab.yml + sudo -u git -H sed '/new_issue_url: "{{REDMINE_URL}}/d' -i /home/git/gitlab/config/gitlab.yml +fi + # configure relative_url_root if [ ${GITLAB_RELATIVE_URL_ROOT} ]; then sudo -u git -H sed 's,# config.relative_url_root = "/gitlab",config.relative_url_root = "'${GITLAB_RELATIVE_URL_ROOT}'",' -i /home/git/gitlab/config/application.rb From b98abd5c19308844ac62a0c14d3116c531a6a411 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Thu, 14 Aug 2014 21:52:21 +0530 Subject: [PATCH 2/2] added support for jira issue tracker --- Changelog.md | 1 + README.md | 9 ++++++++- assets/config/gitlabhq/gitlab.yml | 10 +++++----- assets/init | 13 +++++++++++++ 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index a6dffbeb..982ce60d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,7 @@ # Changelog **latest** +- added support for jira issue tracker - added support for redmine issue tracker - update to gitlab-shell 1.9.7 - update to the sameersbn/ubuntu:14.04.20140812 baseimage diff --git a/README.md b/README.md index 6644d275..685e588d 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ - [Run under sub URI](#run-under-sub-uri) - [External Issue Trackers](#external-issue-trackers) - [Redmine](#redmine) + - [Jira](#jira) - [Available Configuration Parameters](#available-configuration-parameters) - [Maintenance](#maintenance) - [Creating Backups](#creating-backups) @@ -628,7 +629,7 @@ When you change the sub URI path, you need to recompile all precompiled assets. ### External Issue Trackers -GitLab can be configured to use third party issue trackers such as Redmine. Use of third party issue trackers have to be configured on a per project basis from the project settings page. This means that the GitLab's issue tracker is always the default tracker unless specified otherwise. +GitLab can be configured to use third party issue trackers such as Redmine and Atlassian Jira. Use of third party issue trackers have to be configured on a per project basis from the project settings page. This means that the GitLab's issue tracker is always the default tracker unless specified otherwise. #### Redmine @@ -636,6 +637,12 @@ Support for issue tracking using Redmine can be added by specifying the complete For example, if your Redmine server is accessible at `https://redmine.example.com`, then adding `-e 'REDMINE_URL=https://redmine.example.com'` to the docker run command enables Redmine support in GitLab +#### Jira + +Support for issue tracking using Jira can be added by specifying the complete URL of the Jira web server in the `JIRA_URL` configuration option. + +For example, if your Jira server is accessible at `https://jira.example.com`, then adding `-e 'JIRA_URL=https://jira.example.com'` to the docker run command enables Jira support in GitLab + ### Available Configuration Parameters *Please refer the docker run command options for the `--env-file` flag where you can specify all required environment variables in a single file. This will save you from writing a potentially long docker run command.* diff --git a/assets/config/gitlabhq/gitlab.yml b/assets/config/gitlabhq/gitlab.yml index c73458e4..4619bde1 100644 --- a/assets/config/gitlabhq/gitlab.yml +++ b/assets/config/gitlabhq/gitlab.yml @@ -105,11 +105,11 @@ production: &base # ## :issues_tracker_id - Project Name or Id in external issue tracker new_issue_url: "{{REDMINE_URL}}/projects/:issues_tracker_id/issues/new" # - # jira: - # title: "Atlassian Jira" - # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id" - # issues_url: "http://jira.sample/browse/:id" - # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa" + jira: + title: "Atlassian Jira" + project_url: "{{JIRA_URL}}/issues/?jql=project=:issues_tracker_id" + issues_url: "{{JIRA_URL}}/browse/:id" + new_issue_url: "{{JIRA_URL}}/secure/CreateIssue.jspa" ## Gravatar gravatar: diff --git a/assets/init b/assets/init index f326c803..1b6a8c6b 100755 --- a/assets/init +++ b/assets/init @@ -70,6 +70,7 @@ LDAP_BASE=${LDAP_BASE:-} LDAP_USER_FILTER=${LDAP_USER_FILTER:-} REDMINE_URL=${REDMINE_URL:-} +JIRA_URL=${JIRA_URL:-} # is a redis container linked? if [ -n "${REDISIO_PORT_6379_TCP_ADDR}" ]; then @@ -403,6 +404,18 @@ else sudo -u git -H sed '/new_issue_url: "{{REDMINE_URL}}/d' -i /home/git/gitlab/config/gitlab.yml fi +# apply jira configuration +if [ -n "${JIRA_URL}" ]; then + sudo -u git -H sed 's,{{JIRA_URL}},'"${JIRA_URL}"',g' -i /home/git/gitlab/config/gitlab.yml +else + # remove the jira configuration block + sudo -u git -H sed '/jira:/d' -i /home/git/gitlab/config/gitlab.yml + sudo -u git -H sed '/title: "Atlassian Jira"/d' -i /home/git/gitlab/config/gitlab.yml + sudo -u git -H sed '/project_url: "{{JIRA_URL}}/d' -i /home/git/gitlab/config/gitlab.yml + sudo -u git -H sed '/issues_url: "{{JIRA_URL}}/d' -i /home/git/gitlab/config/gitlab.yml + sudo -u git -H sed '/new_issue_url: "{{JIRA_URL}}/d' -i /home/git/gitlab/config/gitlab.yml +fi + # configure relative_url_root if [ ${GITLAB_RELATIVE_URL_ROOT} ]; then sudo -u git -H sed 's,# config.relative_url_root = "/gitlab",config.relative_url_root = "'${GITLAB_RELATIVE_URL_ROOT}'",' -i /home/git/gitlab/config/application.rb