From c9c8640f273bcfc10da1035d5896178d9f00acd0 Mon Sep 17 00:00:00 2001 From: Praveen Arimbrathodiyil Date: Sat, 23 Jan 2016 21:05:43 +0530 Subject: [PATCH] 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(-) create mode 100644 debian/patches/0108-make-mysql-optional.patch diff --git a/debian/changelog b/debian/changelog index 227f41fd6b..8ba8b54af4 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 Fri, 22 Jan 2016 20:48:24 +0530 diff --git a/debian/conf/gitlab-debian.conf b/debian/conf/gitlab-debian.conf index fb14aa50c0..8a42b618f9 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 0000000000..ca7b1d3675 --- /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 +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 0ec067e139..890c618c3b 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 f98cd9d000..5ddbd2d3bf 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'