[DRE-commits] [diaspora-installer] 12/12: use BUNDLE_WITH variable for database selection
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Sun Aug 28 05:18:00 UTC 2016
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository diaspora-installer.
commit 593da0009481d3831bcdffbf039f09caf9cbce7d
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Sun Aug 28 10:23:15 2016 +0530
use BUNDLE_WITH variable for database selection
---
debian/postinst | 4 ++--
diaspora.conf | 1 +
set-env-diaspora.sh | 9 +++++----
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/debian/postinst b/debian/postinst
index 4ffc511..262a2b7 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -36,7 +36,7 @@ case "$1" in
cd ${diaspora_home}
echo "Setting up environment varibales..."
. /usr/lib/diaspora-common/scripts/set-env-diaspora.sh
- export RAILS_ENV=$RAILS_ENV DB=$DB ENVIRONMENT_URL=$ENVIRONMENT_URL
+ export RAILS_ENV=$RAILS_ENV BUNDLE_WITH=${BUNDLE_WITH} ENVIRONMENT_URL=$ENVIRONMENT_URL
echo "Installing latest version of bundler..."
gem install bundler
@@ -47,7 +47,7 @@ https://github.com/hyperic/sigar/issues/60 ..."
su diaspora -s /bin/sh -c "bundle config --local build.sigar '--with-cppflags=\"-fgnu89-inline\"'"
echo "Installing gems with rubygems ..."
- su diaspora -s /bin/sh -c "bundle install --path vendor/bundle --with $DB --without development test"
+ su diaspora -s /bin/sh -c "bundle install --path vendor/bundle --with ${BUNDLE_WITH} --without development test"
# Check if the db is already present
if [ "$(LANG=C su postgres -c "psql diaspora_production -c \"\d\"")" = \
diff --git a/diaspora.conf b/diaspora.conf
index 85e65d3..925c724 100644
--- a/diaspora.conf
+++ b/diaspora.conf
@@ -1,2 +1,3 @@
export RAILS_ENV=production
export DB=postgres
+export BUNDLE_WITH=postgresql
diff --git a/set-env-diaspora.sh b/set-env-diaspora.sh
index df0e65d..9fb566b 100755
--- a/set-env-diaspora.sh
+++ b/set-env-diaspora.sh
@@ -8,10 +8,11 @@ if ! grep RAILS_ENV ${diaspora_conf_private}
fi
if ! grep DB ${diaspora_conf_private}
- then echo export DB=postgresql >> ${diaspora_conf_private}
- # Diaspora versions before 0.6 used DB=postgres
- # Now it uses --with postgresql
- else sed -i 's/postgres/postgresql/' ${diaspora_conf_private}
+ then echo export DB=postgres >> ${diaspora_conf_private}
+fi
+
+if ! grep BUNDLE_WITH ${diaspora_conf_private}
+ then echo export BUNDLE_WITH=postgresql >> ${diaspora_conf_private}
fi
# source diaspora variables
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/diaspora-installer.git
More information about the Pkg-ruby-extras-commits
mailing list