[DRE-commits] [gitlab] 01/02: make mysql optional

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Sat Jan 23 16:42:05 UTC 2016


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository gitlab.

commit c9c8640f273bcfc10da1035d5896178d9f00acd0
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Sat Jan 23 21:05:43 2016 +0530

    make mysql optional
---
 debian/changelog                              |  3 ++-
 debian/conf/gitlab-debian.conf                |  2 ++
 debian/patches/0108-make-mysql-optional.patch | 25 +++++++++++++++++++++++++
 debian/patches/series                         |  1 +
 debian/postinst                               |  3 ---
 5 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 227f41f..8ba8b54 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 gitlab (8.4.0+dfsg~rc2-2) UNRELEASED; urgency=medium
 
-  * Add README.Debian to document debian specific changes 
+  * Add README.Debian to document debian specific changes
+  * Make mysql optional (Closes: #812345)
 
  -- Pirate Praveen <praveen at debian.org>  Fri, 22 Jan 2016 20:48:24 +0530
 
diff --git a/debian/conf/gitlab-debian.conf b/debian/conf/gitlab-debian.conf
index fb14aa5..8a42b61 100644
--- a/debian/conf/gitlab-debian.conf
+++ b/debian/conf/gitlab-debian.conf
@@ -1,3 +1,5 @@
+export RAILS_ENV=production
+export DB=postgres
 export gitlab_user=gitlab
 export gitlab_conf=/etc/gitlab.conf
 export gitlab_home=/usr/share/gitlab
diff --git a/debian/patches/0108-make-mysql-optional.patch b/debian/patches/0108-make-mysql-optional.patch
new file mode 100644
index 0000000..ca7b1d3
--- /dev/null
+++ b/debian/patches/0108-make-mysql-optional.patch
@@ -0,0 +1,25 @@
+From 85ec69dca3e07b27079efe1392574d7fb317186f Mon Sep 17 00:00:00 2001
+From: Pirate Praveen <praveen at debian.org>
+Date: Sat, 23 Jan 2016 10:14:15 -0500
+Subject: [PATCH] allow specifying DB choice via ENV variable
+
+---
+ Gemfile | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+Index: gitlab/Gemfile
+===================================================================
+--- gitlab.orig/Gemfile
++++ gitlab/Gemfile
+@@ -14,8 +14,9 @@ gem 'sprockets', '~> 3.3.0'
+ gem "default_value_for", "~> 3.0.0"
+ 
+ # Supported DBs
+-gem "mysql2", '~> 0.3.16', group: :mysql
+-gem "pg", '~> 0.18.2', group: :postgres
++ENV["DB"] ||= "mysql"
++gem "mysql2", '~> 0.3.16' if ENV["DB"] == "all" || ENV["DB"] == "mysql"
++gem "pg", '~> 0.18.2' if ENV["DB"] == "all" || ENV["DB"] == "postgres"
+ 
+ # Authentication libraries
+ gem 'devise',                 '~> 3.5.2'
diff --git a/debian/patches/series b/debian/patches/series
index 0ec067e..890c618 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,5 +11,6 @@ loosen-rails-version.patch
 0100-remove-development-test.patch
 0102-loosen-octokit.patch
 0107-relax-omniauth-facebook.patch
+0108-make-mysql-optional.patch
 source-init-functions.patch
 0300-no-hard-coded-workhorse-path.patch
diff --git a/debian/postinst b/debian/postinst
index f98cd9d..5ddbd2d 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -54,9 +54,6 @@ case "$1" in
 
 	# Adjust database privileges
 	. /usr/lib/gitlab/scripts/grantpriv.sh
-	echo "Setting up environment varibales..."
-	export RAILS_ENV=production
-	export DB=postgres
 	
 	echo "Verifying we have all required libraries..."
 	su ${gitlab_user} -s /bin/sh -c	'bundle install --local'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gitlab.git



More information about the Pkg-ruby-extras-commits mailing list