Created
May 5, 2017 03:47
-
-
Save diligasi/3a2903b662e1c8c5683c98dc84ee6102 to your computer and use it in GitHub Desktop.
This file contains the initial settings of a Vagrant machine with Ubuntu. In this file there are instructions for system upgrade and also the installation and configuration of Git, RVM, Ruby, Rails, MySQL and OH-MY-ZSH, the latter is a tool to improve the usability of Git in the terminal.
This file contains hidden or 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
RUBY_VERSION="2.4.0" # You can change for any version you like | |
RAILS_VERSION="5.0.2" # You can change for any version you like | |
MYSQL_PASSWORD="XXXXX" # Remember to change for your own password | |
GIT_USER_NAME="XXXXX XXXXX" # Remember to change for your own user name | |
GIT_USER_EMAIL="[email protected]" # Remember to change for your own git email | |
NODE_VERSION="6" # You can change for any version you like | |
echo | |
echo "========================================================================" | |
echo "# ATUALIZANDO O SISTEMA OPERACIONAL" | |
echo "========================================================================" | |
sudo apt-get update && sudo apt-get upgrade -y | |
echo | |
echo "========================================================================" | |
echo "# INSTALANDO E CONFIGURANDO O GIT" | |
echo "========================================================================" | |
sudo add-apt-repository ppa:git-core/ppa -y | |
sudo apt-get update | |
sudo apt-get install git -y | |
git config --global user.name "${GIT_USER_NAME}" | |
git config --global user.email "${GIT_USER_EMAIL}" | |
echo | |
echo "========================================================================" | |
echo "# INSTALANDO DEPENDENCIAS DO RVM/RUBY" | |
echo "========================================================================" | |
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \ | |
libsqlite3-dev sqlite3 libxml2-dev libcurl4-openssl-dev python-software-properties \ | |
libffi-dev nodejs libgdbm-dev libncurses5-dev automake libtool bison libxslt1-dev | |
echo | |
echo "=======================================================================" | |
echo "# INSTALANDO E CONFIGURANDO O RVM" | |
echo "========================================================================" | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
\curl -sSL https://get.rvm.io | bash -s stable | |
source ~/.rvm/scripts/rvm | |
rvm requirements | |
echo | |
echo "========================================================================" | |
echo "# INSTALANDO E CONFIGURANDO O RUBY NA VERSAO: ${RUBY_VERSION}" | |
echo "========================================================================" | |
rvm install ${RUBY_VERSION} | |
rvm use ${RUBY_VERSION} --default | |
touch ~/.gemrc | |
echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc | |
echo | |
echo "========================================================================" | |
echo "# INSTALANDO E CONFIGURANDO O RAILS NA VERSAO: ${RAILS_VERSION}" | |
echo "========================================================================" | |
\curl -sSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo -E bash - | |
sudo apt-get update | |
sudo apt-get install nodejs -y | |
gem install rails -v ${RAILS_VERSION} | |
echo | |
echo "========================================================================" | |
echo "# INSTALANDO E CONFIGURANDO O MYSQL" | |
echo "========================================================================" | |
sudo apt-get install debconf-utils -y | |
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password ${MYSQL_PASSWORD}" | |
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ${MYSQL_PASSWORD}" | |
sudo apt-get install mysql-server mysql-client libmysqlclient-dev -y | |
echo | |
echo "========================================================================" | |
echo "# INSTALANDO E CONFIGURANDO O OH-MY-ZSH" | |
echo "========================================================================" | |
sudo apt-get update | |
sudo apt-get install zsh -y | |
echo "# setup zsh" >> .profile | |
echo "export SHELL=/bin/zsh" >> .profile | |
echo "[ -z "$ZSH_VERSION" ] && exec /bin/zsh -l" >> .profile | |
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh | |
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment