Skip to content

Commit

Permalink
Merge branch 'scripts' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
LisaMc committed Mar 24, 2016
2 parents 77d07e6 + 5e32ceb commit 8f52ab5
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 0 deletions.
70 changes: 70 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash
set -e

OS=$(uname -s)

if [ "$OS" = "Darwin" ] ; then
# install R
R_BIN=$(which r)
if [ -z "$R_BIN" ] ; then
wget http://cran.fhcrc.org/bin/macosx/R-3.2.3.pkg
sudo /usr/sbin/installer -pkg R-3.2.3.pkg -target /
fi

# install pip
PIP_BIN=$(which pip)
if [ -z "$PIP_BIN" ] ; then
sudo easy_install pip
fi
elif [ "$OS" = "Linux" ] ; then
# figure out what we're running on
DISTRO=$(lsb_release -i -s)
CODENAME=$(lsb_release -c -s)

# figure out what APT repo to use
if [ "$DISTRO" = "Ubuntu" ] ; then
REPO="http://cran.fhcrc.org/bin/linux/ubuntu ${CODENAME}/"
elif [ "$DISTRO" = "Debian" ] ; then
if [ "$CODENAME" = "sid" ] ; then
# sid already has this
REPO="none"
else
REPO="http://cran.fhcrc.org/bin/linux/debian ${CODENAME}-cran3/"
fi
else
echo "Sorry, I don't know how to bootstrap for $DISTRO"
exit 1
fi

# if we have an apt repo, add it and its key to sources.list
if [ "$REPO" != "none" ] ; then
sudo echo "deb http://cran.fhcrc.org/bin/linux/$DISTRO trusty/" > /etc/apt/sources.list.d/cran.fhcrc.org.list

# Add the package verification key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9
fi

# Update the system and install packages
sudo apt-get -y update && apt-get -y install \
r-base=3.2.2* \
vim \
make \
git \
m4 \
gcc \
g++ \
libxml2 \
libxml2-dev \
python-pip
else
echo "Sorry, I don't know how to bootstrap for $OS"
exit 1
fi

# install the websocket client
if ! python -c "import websocket" ; then
sudo pip install websocket-client
fi

echo "All prerequisites should be installed!"
exit 0
9 changes: 9 additions & 0 deletions script/server
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e
set -x

ONCOSCAPE_ROOT=$(cd "$(dirname $0)/.." && pwd)
export ONCOSCAPE_USER_DATA_STORE="file:///${ONCOSCAPE_ROOT}/userdata"
export R_LIBS="${ONCOSCAPE_ROOT}/rlibs"

cd $ONCOSCAPE_ROOT && make oncoAppLocal7777
9 changes: 9 additions & 0 deletions script/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e
set -x

ONCOSCAPE_ROOT=$(cd "$(dirname $0)/.." && pwd)
mkdir -p ${ONCOSCAPE_ROOT}/rlibs ${ONCOSCAPE_ROOT}/userdata
export R_LIBS="${ONCOSCAPE_ROOT}/rlibs"

cd $ONCOSCAPE_ROOT && make installLocal
9 changes: 9 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e
set -x

ONCOSCAPE_ROOT=$(cd "$(dirname $0)/.." && pwd)
export ONCOSCAPE_USER_DATA_STORE="file:///${ONCOSCAPE_ROOT}/userdata"
export R_LIBS="${ONCOSCAPE_ROOT}/rlibs"

cd $ONCOSCAPE_ROOT && sudo make test

0 comments on commit 8f52ab5

Please sign in to comment.