gluster-web-interface/script/setup.sh

77 lines
1.9 KiB
Bash
Raw Permalink Normal View History

2017-12-29 12:58:46 +00:00
#! /bin/bash
2016-08-28 07:58:27 +00:00
# Install bower, bundler, packages
function install {
2017-12-29 12:58:46 +00:00
npm install bower
bower install --allow-root
gem install bundler
bundle install
}
2016-09-19 03:34:27 +00:00
2016-08-28 07:58:27 +00:00
# setup
function setup {
bin/rake db:migrate
}
# Go
case "$(uname -s)" in
Darwin)
echo 'Mac OS X'
#brew install sshpass
2017-10-22 04:54:03 +00:00
rbenv -v
if [ $? -ne 0 ]; then
echo 'Install rbenv'
brew install rbenv
2017-10-22 06:30:44 +00:00
brew install ruby-build
echo 'export RBENV_ROOT=/usr/local/var/rbenv' >> ~/.bash_profile
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bashrc
2017-10-22 04:54:03 +00:00
fi
2017-10-22 06:30:44 +00:00
rbenv install 2.3.3
2017-10-22 04:54:03 +00:00
rbenv local 2.3.3
install
setup
;;
Linux)
echo 'Linux'
# version check
#if grep centos /etc/*-release; then
# echo "os : centos, use yum"
# yum install sshpass
#elif grep ubuntu /etc/*-release; then
# echo "os : ubuntu, use apt-get install"
# apt-get install sshpass
#fi
2017-12-30 04:10:06 +00:00
echo 'Install essential packages'
sudo apt-get update
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
2017-10-22 04:54:03 +00:00
rbenv -v
if [ $? -ne 0 ]; then
echo 'Install rbenv'
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
2017-12-30 04:10:06 +00:00
source ~/.bashrc
fi
ruby-build --version
if [ $? -ne 0 ]; then
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
2017-12-30 04:10:06 +00:00
source ~/.bashrc
2017-10-22 04:54:03 +00:00
fi
2017-10-22 06:30:44 +00:00
rbenv install 2.3.3
2017-10-22 04:54:03 +00:00
rbenv local 2.3.3
install
setup
;;
CYGWIN*|MINGW32*|MSYS*)
echo 'MS Windows'
;;
*)
echo 'other OS'
;;
esac