Last active
August 29, 2015 14:15
-
-
Save lazybios/f5e45b4aa08d0eee6b60 to your computer and use it in GitHub Desktop.
deploy_to_vps shell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# update and basic tools | |
sudo apt-get -y update | |
sudo apt-get -y install curl git-core python-software-properties | |
# install nginx | |
sudo add-apt-repository ppa:nginx/stable | |
sudo apt-get -y update | |
sudo apt-get -y install nginx | |
# start nginx service test service | |
service nginx start | |
curl localhost | |
# install mysql | |
sudo add-apt-repository -y ppa:ondrej/mysql-5.6 | |
sudo apt-get -y update | |
sudo apt-get -y install mysql-server | |
# alertnative cli | |
sudo apt-get install -y mysql-client mysql-server libmysqlclient-dev | |
# install nodejs | |
sudo add-apt-repository ppa:chris-lea/node.js | |
sudo apt-get -y update | |
sudo apt-get -y install nodejs | |
# so that I dont need to install therubyracer | |
# Add deployer user | |
sudo adduser deployer --ingroup admin | |
su deployer | |
cd | |
# install rbenv for mutiple ruby versions | |
curl https://raw.githubusercontent.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash | |
vim .bashrc # add rbenv to the bottom | |
. .bashrc | |
rbenv bootstrap-ubuntu-12-04 # need password | |
rbenv install --list # list all versions of ruby | |
rbenv install 2.0.0-p481 | |
rbenv global 2.0.0-p481 | |
rbenv versions # 列出安装的版本 | |
rbenv version # 列出正在使用的版本 | |
rbenv global 1.9.3-p392 # 默认使用 1.9.3-p392 | |
rbenv shell 1.9.3-p392 # 当前的 shell 使用 1.9.3-p392, 会设置一个 `RBENV_VERSION` 环境变量 | |
rbenv local jruby-1.7.3 # 当前目录使用 jruby-1.7.3, 会生成一个 `.rbenv-version` 文件 | |
rbenv rehash # 每当切换 ruby 版本和执行 bundle install 之后必须执行这个命令 | |
rbenv which irb # 列出 irb 这个命令的完整路径 | |
rbenv whence irb # 列出包含 irb 这个命令的版本 | |
# change the source of gem and install rails | |
gem sources --remove https://rubygems.org/ | |
gem sources -a https://ruby.taobao.org/ | |
#gem install rails -v 4.1.6 # bundler will be installed as deps | |
gem install bundler --no-ri --no-rdoc | |
rbenv rehash | |
# install rails by bundler | |
# Get to know github.com | |
ssh -T [email protected] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment