[DRE-commits] [diaspora-installer] 02/02: move rake raks to diaspora-common

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Sat May 2 14:49:42 UTC 2015


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

praveen pushed a commit to branch master
in repository diaspora-installer.

commit 80f751b0098caf92524c817d763eac93efdfc2db
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Sat May 2 20:16:41 2015 +0530

    move rake raks to diaspora-common
---
 debian/diaspora-common.install  |  1 +
 debian/diaspora-common.postinst |  1 +
 debian/postinst                 | 38 +++++++++++++++-----------------------
 rake-tasks.sh                   | 20 ++++++++++++++++++++
 4 files changed, 37 insertions(+), 23 deletions(-)

diff --git a/debian/diaspora-common.install b/debian/diaspora-common.install
index af4844e..2054348 100644
--- a/debian/diaspora-common.install
+++ b/debian/diaspora-common.install
@@ -2,4 +2,5 @@ adduser.sh usr/lib/diaspora-common/scripts
 grantpriv.sh usr/lib/diaspora-common/scripts
 set-env-nginx.sh usr/lib/diaspora-common/scripts
 set-env-diaspora.sh usr/lib/diaspora-common/scripts
+rake-tasks.sh usr/lib/diaspora-common/scripts
 diaspora-common.conf /etc/diaspora
diff --git a/debian/diaspora-common.postinst b/debian/diaspora-common.postinst
index b7ea57b..9d9a094 100755
--- a/debian/diaspora-common.postinst
+++ b/debian/diaspora-common.postinst
@@ -40,6 +40,7 @@ case "$1" in
 	${diaspora_scripts}/adduser.sh
 	${diaspora_scripts}/grantpriv.sh
 	mkdir -p ${diaspora_nginx_log}
+	mkdir -p ${diaspora_home}
 	chown -R ${diaspora_user}: ${diaspora_home}
   ;;
 
diff --git a/debian/postinst b/debian/postinst
index e8f8076..1ebccea 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -37,22 +37,21 @@ case "$1" in
 		if test ${diaspora_release_type} = "branch"
 		then
 			wget -O ${diaspora_cache}/diaspora-${diaspora_version}.tar.gz ${github_archive_url}/release/${diaspora_version}.tar.gz
+			export diaspora_archive="diaspora-release-${diaspora_version}"
 		else
 			wget -O ${diaspora_cache}/diaspora-${diaspora_version}.tar.gz ${github_archive_url}/v${diaspora_version}.tar.gz
+			export diaspora_archive="diaspora-${diaspora_version}"
 		fi
 	fi
 	echo "Already downloaded..."
 	echo "Extracting files..."
 	tar -C ${diaspora_cache} -zxvf ${diaspora_cache}/diaspora-${diaspora_version}.tar.gz >/dev/null
 	echo "Copying files to ${diaspora_home}..."
-	if test ${diaspora_release_type} = "branch"
-	then
-		rm -rf ${diaspora_cache}/diaspora-release-${diaspora_version}/bin
-		sudo -u ${diaspora_user} cp -r ${diaspora_cache}/diaspora-release-${diaspora_version}/* ${diaspora_home}
-	else
-		rm -rf ${diaspora_cache}/diaspora-${diaspora_version}/bin
-		sudo -u ${diaspora_user} cp -r ${diaspora_cache}/diaspora-${diaspora_version}/* ${diaspora_home}
-	fi
+	# Use system binaries from /usr/bin
+	rm -rf ${diaspora_cache}/${diaspora_archive}/bin
+	cp -r ${diaspora_cache}/${diaspora_archive}/* ${diaspora_home}
+	chown -R ${diaspora_user}: ${diaspora_home}
+
 	echo "Copying source tarball to ${diaspora_home}/public..."
 	sudo -u ${diaspora_user} cp ${diaspora_cache}/diaspora-${diaspora_version}.tar.gz ${diaspora_home}/public/source.tar.gz
 	
@@ -62,21 +61,14 @@ case "$1" in
 
 	echo "Installing gems with rubygems ..."
 	sudo -u diaspora -E bundle install --path vendor/bundle
-	echo "Initializing database..."
-	sudo -u diaspora -E bundle exec rake db:create db:schema:load
-	echo "Precompiling assets..."
-	sudo -u diaspora -E bundle exec rake assets:precompile
-	echo "Setting up secret_token..."
-	if ! grep config.secret_token ${diaspora_home}/config/initializers/secret_token.rb
-		then 
-		echo Diaspora::Application.config.secret_token = \'$(sudo -u diaspora -E bundle exec rake secret)\' >> ${diaspora_home}/config/initializers/secret_token.rb
-	fi
-	echo "Starting diaspora service..."
-	invoke-rc.d diaspora start
-	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"
-	echo "visit your pod at $ENVIRONMENT_URL"
+
+#	echo "Setting up secret_token..."
+#	if ! grep config.secret_token ${diaspora_home}/config/initializers/secret_token.rb
+#		then 
+#		echo Diaspora::Application.config.secret_token = \'$(sudo -u diaspora -E bundle exec rake secret)\' >> ${diaspora_home}/config/initializers/secret_token.rb
+#	fi
+	echo "Running final rake tasks..."
+	. /usr/lib/diaspora-common/scripts/rake-tasks.sh
    ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/rake-tasks.sh b/rake-tasks.sh
new file mode 100755
index 0000000..9192d85
--- /dev/null
+++ b/rake-tasks.sh
@@ -0,0 +1,20 @@
+#! /bin/sh
+# Read configuration values	
+. /etc/diaspora/diaspora-common.conf
+
+echo "Initializing database..."
+sudo -u diaspora -E bundle exec rake db:create db:schema:load
+echo "Precompiling assets..."
+sudo -u diaspora -E bundle exec rake assets:precompile
+sudo -u diaspora  touch public/source.tar.gz
+echo "Starting diaspora service..."
+sudo -u diaspora -E -i nohup ./script/server &
+
+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"
+echo "visit your pod at $ENVIRONMENT_URL"
+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"
+

-- 
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