[DRE-commits] [gitlab] 03/04: import postinst from diaspora
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Sat Sep 12 10:23:35 UTC 2015
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository gitlab.
commit 80939adbee6a8e9e4c65dc27de5425c3310a9c72
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Sat Sep 12 15:42:12 2015 +0530
import postinst from diaspora
---
debian/gitlab-debian.conf | 7 ++++++
debian/postinst | 59 +++++++++++++++++++++++++++++++++++++++++++++++
debian/rake-tasks.sh | 25 ++++++++++++++++++++
3 files changed, 91 insertions(+)
diff --git a/debian/gitlab-debian.conf b/debian/gitlab-debian.conf
new file mode 100644
index 0000000..ab33ad8
--- /dev/null
+++ b/debian/gitlab-debian.conf
@@ -0,0 +1,7 @@
+export gitlab_user=gitlab
+export gitlab_conf=/etc/gitlab.conf
+export gitlab_home=/usr/share/gitlab
+export gitlab_scripts=/usr/lib/gitlab/scripts
+export gitlab_nginx_log=/var/log/gitlab
+export gitlab_ssl_path=/etc/gitlab/ssl
+
diff --git a/debian/postinst b/debian/postinst
new file mode 100755
index 0000000..80c794d
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,59 @@
+#! /bin/sh
+# postinst script for gitlab
+# copied from postinst script for hplip
+# $Id: hplip.postinst,v 1.1 2005/10/15 21:39:04 hmh Exp $
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+# quoting from the policy:
+# Any necessary prompting should almost always be confined to the
+# post-installation script, and should be protected with a conditional
+# so that unnecessary prompting doesn't happen if a package's
+# installation fails and the `postinst' is called with `abort-upgrade',
+# `abort-remove' or `abort-deconfigure'.
+
+
+case "$1" in
+ configure)
+
+ . /etc/gitlab/gitlab-debian.conf
+ chown -R ${gitlab_user}: ${gitlab_home}
+ cd ${diaspora_home}
+
+ echo "Setting up environment varibales..."
+ export RAILS_ENV=production
+ export DB=postgres
+
+ echo "Verifying we have all required libraries..."
+ sudo -u diaspora -E bundle install --local
+
+ echo "Running final rake tasks..."
+ # Move these to rails-common
+ #. /usr/lib/diaspora-common/scripts/rake-tasks.sh
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rake-tasks.sh b/debian/rake-tasks.sh
new file mode 100755
index 0000000..832c224
--- /dev/null
+++ b/debian/rake-tasks.sh
@@ -0,0 +1,25 @@
+#! /bin/sh
+# Read configuration values
+. /etc/diaspora/diaspora-common.conf
+
+echo "Initializing database..."
+su diaspora -s /bin/sh -c 'bundle exec rake db:create db:schema:load'
+echo "Precompiling assets..."
+su diaspora -s /bin/sh -c 'bundle exec rake assets:precompile'
+su diaspora -s /bin/sh -c 'touch public/source.tar.gz'
+
+#Starting diaspora service...
+invoke-rc.d diaspora start
+
+if grep https ${diaspora_conf}
+then
+ mkdir -p ${diaspora_ssl_path}
+ echo "Copy $SERVERNAME-bundle.pem and $SERVERNAME.key to /etc/diaspora/ssl"
+ echo "And reload nginx, run # /etc/init.d/nginx reload"
+fi
+
+echo "To stop diaspora, run # /etc/init.d/diaspora stop"
+echo "To see the service status, run # /etc/init.d/diaspora status"
+echo "To start diaspora service, run # /etc/init.d/diaspora start"
+
+echo "Visit your pod at $ENVIRONMENT_URL"
--
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