mailr28126 - /trunk/devel_scripts/deploy_google_computing_ubuntu.sh


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by tlinnet on November 28, 2015 - 22:55:
Author: tlinnet
Date: Sat Nov 28 22:55:26 2015
New Revision: 28126

URL: http://svn.gna.org/viewcvs/relax?rev=28126&view=rev
Log:
Splitting deploy script into several small functions.

Modified:
    trunk/devel_scripts/deploy_google_computing_ubuntu.sh

Modified: trunk/devel_scripts/deploy_google_computing_ubuntu.sh
URL: 
http://svn.gna.org/viewcvs/relax/trunk/devel_scripts/deploy_google_computing_ubuntu.sh?rev=28126&r1=28125&r2=28126&view=diff
==============================================================================
--- trunk/devel_scripts/deploy_google_computing_ubuntu.sh       (original)
+++ trunk/devel_scripts/deploy_google_computing_ubuntu.sh       Sat Nov 28 
22:55:26 2015
@@ -2,10 +2,32 @@
 # -*- coding: UTF-8 -*-
 # Script for deploying relax on Google Cloud Computing GCC
 
-function download {
+# Install apt-get packages
+function doaptget {
   # Install lynx
   sudo apt-get -y install lynx
 
+  # Install for server management
+  sudo apt-get -y install htop
+
+  # Install for running relax in multiple CPU mode
+  sudo apt-get -y install openmpi-bin openmpi-doc libopenmpi-dev
+
+  # Install dependencies
+  sudo apt-get -y install python-numpy
+  sudo apt-get -y install python-scipy python-matplotlib python-pip
+
+  # For trunk checkout and graphs
+  sudo apt-get -y install subversion scons grace
+}
+
+# Install python packages
+function dopip {
+  sudo pip install mpi4py
+  sudo pip install epydoc
+}
+
+function getversions {
   # From the wiki, get current versions
   VMIN=`lynx -dump 
"http://wiki.nmr-relax.com/Template:Current_version_minfx"; | grep -A 10 
"Template:Current version minfx" | grep -B 1 "Retrieved from" | head -n 1 | 
tr -d '[[:space:]]'`
   VBMR=`lynx -dump 
"http://wiki.nmr-relax.com/Template:Current_version_bmrblib"; | grep -A 10 
"Template:Current version bmrblib" | grep -B 1 "Retrieved from" | head -n 1 | 
tr -d '[[:space:]]'`
@@ -16,26 +38,18 @@
   echo "Current version of bmrblib is: $VMBR"
   echo "Current version of mpi4py is: $VMPI"
   echo "Current version of relax is: $VREL"
+}
 
-  # Install for server management
-  sudo apt-get -y install htop
-
-  # Install for running relax in multiple CPU mode
-  sudo apt-get -y install openmpi-bin openmpi-doc libopenmpi-dev
-
-  # Install dependencies
-  sudo apt-get -y install python-numpy
-  sudo apt-get -y install python-scipy python-matplotlib python-pip
-  sudo pip install mpi4py
-  sudo pip install epydoc
-  sudo apt-get -y install subversion scons grace
-
-  # Make home bin
+# Make home bin
+function dobin {
   mkdir -p $HOME/bin
   echo '' >> $HOME/.bashrc
   echo 'export PATH=$PATH:$HOME/bin' >> $HOME/.bashrc
   source $HOME/.bashrc
+}
 
+# Do local istallations of pip
+function dopiplocal {
   # Install minfx
   mkdir -p $HOME/Downloads
   cd $HOME/Downloads
@@ -53,24 +67,29 @@
   cd bmrblib-$VBMR
   sudo pip install .
   cd $HOME
+}
 
-  # Get latest compiled version of relax
+# Get latest compiled version of relax
+function getlatest {
+  cd $HOME
   curl http://download.gna.org/relax/relax-$VREL.GNU-Linux.x86_64.tar.bz2 -o 
relax-$VREL.GNU-Linux.x86_64.tar.bz2
   tar xvjf relax-$VREL.GNU-Linux.x86_64.tar.bz2
   rm relax-$VREL.GNU-Linux.x86_64.tar.bz2
-  ln -s $HOME/relax-4.0.0/relax $HOME/bin/relax_$VREL
+  ln -s $HOME/relax-$VREL/relax $HOME/bin/relax_$VREL
+  cd $HOME
+}
 
-  # Get the subversion of relax
+# Get the trunk of relax with subversion
+function gettrunk {
+  cd $HOME
   svn co svn://svn.gna.org/svn/relax/trunk relax_trunk
-
-  # Build
   cd $HOME/relax_trunk
   scons
   ln -s $HOME/relax_trunk/relax $HOME/bin/relax_trunk
   cd $HOME
 }
 
-
+# Do some check of installation
 function checkinstallation {
   # Then check server
   uptime
@@ -87,6 +106,17 @@
   relax_svn -i
 }
 
+# Combine functions
+function installandcheck {
+  doaptget
+  dopip
+  getversions
+  dobin
+  dopiplocal
+  getlatest
+  gettrunk
+  checkinstallation
+}
+
 # Do functions
-download
-checkinstallation
+installandcheck




Related Messages


Powered by MHonArc, Updated Sat Nov 28 23:20:13 2015