myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2982] trunk/installers: Changed to using mkdir -


From: noreply
Subject: [myexperiment-hackers] [2982] trunk/installers: Changed to using mkdir -p and generally tidied up installers so more consistent across OSs
Date: Mon, 16 Apr 2012 13:21:22 +0000 (UTC)

Revision
2982
Author
drn05r
Date
2012-04-16 13:21:22 +0000 (Mon, 16 Apr 2012)

Log Message

Changed to using mkdir -p and generally tidied up installers so more consistent across OSs

Modified Paths

Diff

Modified: trunk/installers/fedora/default_settings.bash (2981 => 2982)


--- trunk/installers/fedora/default_settings.bash	2012-03-28 14:54:09 UTC (rev 2981)
+++ trunk/installers/fedora/default_settings.bash	2012-04-16 13:21:22 UTC (rev 2982)
@@ -46,7 +46,7 @@
  #            NOTE: No trailing slash.
  
 -base_uri: http://www.example.com
-+base_uri: http://'${myexp_cname}:${myexp_port_no}'
++base_uri: http://'${myexp_cname}':'${myexp_port_no}'
  
  # admins - Set "admins" to the list of usernames of people that are
  #          administrators of this installation.  This is "Username" that is set
@@ -96,7 +96,7 @@
         echo "Starting myExperiment..."
         source /usr/local/rvm/scripts/rvm
         rvm --default use '${ruby_version}'
-        cd $MYEXP_DIR
+        cd $MYEXP_DIR || { exit 1; }
         rake solr:start 2>> $SOLR_ERR_FILE 1>> $SOLR_LOG_FILE
         ruby script/server -p '${myexp_port_no}' 2>> $MYEXP_ERR_FILE 1>> $MYEXP_LOG_FILE &
         echo $! > $MYEXP_PID_FILE 
@@ -106,7 +106,7 @@
         echo "Stopping myExperiment..."
         source /usr/local/rvm/scripts/rvm
         rvm --default use '${ruby_version}'
-        cd $MYEXP_DIR 
+        cd $MYEXP_DIR || { exit 1; }
         rake solr:stop 2>> $SOLR_ERR_FILE 1>> $SOLR_LOG_FILE 
         if [ -s $MYEXP_PID_FILE ]; then
             kill -9 `cat $MYEXP_PID_FILE` 

Modified: trunk/installers/fedora/install.bash (2981 => 2982)


--- trunk/installers/fedora/install.bash	2012-03-28 14:54:09 UTC (rev 2981)
+++ trunk/installers/fedora/install.bash	2012-04-16 13:21:22 UTC (rev 2982)
@@ -38,17 +38,10 @@
 source "/usr/local/rvm/scripts/rvm" || { echo "Could not source /usr/local/rvm/scripts/rvm to add RVM directory to path. Aborting ..."; exit 18; }
 rvmsudo rvm install ${ruby_version}  || { echo "Could not install Ruby ${ruby_version} using RVM. Aborting ..."; exit 19; }
 rvm --default use ${ruby_version} || { echo "Could not set Ruby ${ruby_version} as the default environment for RVM. Aborting ..."; exit 20; }
+
 echo "Checking out myExperiment codebase from SVN"
-cd /
-for idir in `echo ${install_dir} | awk 'BEGIN{RS="/"}{print $1}'`; do
-        if [ -n ${idir} ]; then
-                if  [ ! -d ${idir} ]; then
-                        sudo mkdir ${idir} || { echo "Could not create directory ${idir} in `pwd`.  Aborting ..."; exit 21; }
-                fi
-                cd ${idir}
-        fi
-done
-sudo chown ${USER} ${install_dir} || { echo "Could not update permissions on ${install_dir}. Aborting ..."; exit 22; }
+sudo mkdir -p ${install_dir} || { echo "Could not create directory ${install_dir} or one of its parent directories. Aborting ..."; exit 21; }
+sudo chown ${USER}:${USER} ${install_dir} || { echo "Could not update permissions on ${install_dir}. Aborting ..."; exit 22; }
 svn checkout svn://rubyforge.org/var/svn/myexperiment/$branch $install_dir || { echo "Could not checkout SVN to $install_dir. Aborting ..."; exit 24; }
 cd ${install_dir}/config/ || { echo "Could not find config directory for myExperiment. Aborting ..."; exit 25; }
 
@@ -97,8 +90,8 @@
 sudo rm -rf ${tempdir} || { echo "Could not remove temporary directory used by patch files."; exit 55; }
 
 echo ""
-echo "==================================================================================="
-echo " myExperiment is now fully installed."
-echo " Go to http://${myexp_cname}:${myexp_port_no}/ to use myExperiment"
-echo "==================================================================================="
+echo "========================================================================================================"
+echo " myExperiment is now fully installed. Go to http://${myexp_cname}:${myexp_port_no}/ to use myExperiment"
+echo " To start, stop or restart myExperiment use: sudo service myexperiment start|stop|restart" 
+echo "========================================================================================================"
 

Modified: trunk/installers/ubuntu/default_settings.bash (2981 => 2982)


--- trunk/installers/ubuntu/default_settings.bash	2012-03-28 14:54:09 UTC (rev 2981)
+++ trunk/installers/ubuntu/default_settings.bash	2012-04-16 13:21:22 UTC (rev 2982)
@@ -5,6 +5,7 @@
 mysql_root_password="changeme"
 fq_server_name="server.domain"
 myexp_cname="myexp.domain" # Where your myExperiment will be hosted can be the same as $fq_server_name
+myexp_port_no="3000"
 exim_smarthost_server="smtp"
 exim_smarthost_domain="domain"
 exim_smarthost="${exim_smarthost_server}.${exim_smarthost_domain}"
@@ -16,7 +17,7 @@
  #            NOTE: No trailing slash.
  
 -base_uri: http://www.example.com
-+base_uri: http://'${myexp_cname}:3000'
++base_uri: http://'${myexp_cname}':'$myexp_port_no'
  
  # admins - Set "admins" to the list of usernames of people that are
  #          administrators of this installation.  This is "Username" that is set
@@ -61,7 +62,15 @@
 
 initd_script='#!/bin/bash -e
 
-# Starts, stops, and restarts myExperiment
+### BEGIN INIT INFO
+# Provides:          myexperiment
+# Required-Start:    
+# Required-Stop:     
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Starts, stops, and restarts myExperiment.
+# Description:       Starts, stops, and restarts myExperiment.
+### END INIT INFO
 
 MYEXP_DIR="'${install_dir}'"
 SOLR_LOG_FILE="'${install_dir}'/log/solr.log"
@@ -75,7 +84,7 @@
         echo "Starting myExperiment..."
         source /usr/local/rvm/scripts/rvm
         rvm --default use '${ruby_version}'
-        cd $MYEXP_DIR
+        cd $MYEXP_DIR || { exit 1; }
         rake solr:start 2>> $SOLR_ERR_FILE 1>> $SOLR_LOG_FILE
         ruby script/server 2>> $MYEXP_ERR_FILE 1>> $MYEXP_LOG_FILE &
         echo $! > $MYEXP_PID_FILE 
@@ -85,7 +94,7 @@
         echo "Stopping myExperiment..."
         source /usr/local/rvm/scripts/rvm
         rvm --default use '${ruby_version}'
-        cd $MYEXP_DIR 
+        cd $MYEXP_DIR || { exit 1; }
         rake solr:stop 2>> $SOLR_ERR_FILE 1>> $SOLR_LOG_FILE 
         if [ -s $MYEXP_PID_FILE ]; then
             kill -9 `cat $MYEXP_PID_FILE` 

Modified: trunk/installers/ubuntu/install.bash (2981 => 2982)


--- trunk/installers/ubuntu/install.bash	2012-03-28 14:54:09 UTC (rev 2981)
+++ trunk/installers/ubuntu/install.bash	2012-04-16 13:21:22 UTC (rev 2982)
@@ -33,16 +33,8 @@
 rvm --default use ${ruby_version} || { echo "Could not set Ruby ${ruby_version} as the default environment for RVM. Aborting ..."; exit 11; }
 
 echo "Checking out myExperiment codebase from SVN"
-cd /
-for idir in `echo ${install_dir} | awk 'BEGIN{RS="/"}{print $1}'`; do
-	if [ -n ${idir} ]; then
-		if  [ ! -d ${idir} ]; then
-			sudo mkdir ${idir} || { echo "Could not create directory ${idir} in `pwd`. Aborting ..."; exit 12; }
-		fi
-		cd ${idir}
-	fi
-done
-sudo chown ${USER}:www-data ${install_dir} || { echo "Could not update permissions on ${install_dir}. Aborting ..."; exit 13; }
+sudo mkdir -p ${install_dir} || { echo "Could not create directory ${install_dir} or one of its parent directories. Aborting ..."; exit 12; }
+sudo chown ${USER}:${USER} ${install_dir} || { echo "Could not update permissions on ${install_dir}. Aborting ..."; exit 13; }
 svn checkout svn://rubyforge.org/var/svn/myexperiment/${branch} ${install_dir} || { echo "Could not checkout SVN to ${install_dir}. Aborting ..."; exit 14; }
 cd ${install_dir}/config/ || { echo "Could not find config directory for myExperiment. Aborting ..."; exit 15; }
 
@@ -81,8 +73,8 @@
 rm -r ${tempdir} || { echo "Could not delete temporary directory ${tempdir}. Aborting ..."; exit 35; }
 
 echo ""
-echo "+----------------------------------------------------------------------------------------------+"
-echo "|   myExperiment is now fully installed. Go to http://$myexp_cname:3000/ to use myExperiment   |"
-echo "|   To start, stop or restart myExperiment use: sudo service myexperiment start|stop|restart   |" 
-echo "+----------------------------------------------------------------------------------------------+"
+echo "========================================================================================================"
+echo " myExperiment is now fully installed. Go to http://${myexp_cname}:${myexp_port_no}/ to use myExperiment"
+echo " To start, stop or restart myExperiment use: sudo service myexperiment start|stop|restart" 
+echo "========================================================================================================"
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]