#!/bin/bash clear echo NOME="Rodrigo de Avila" EMAIL="rodrigo@avila.net.br" REPO="git@git.corujalab.com.br:antecipador/antecipador-rails.git" if [ ! -f .ssh/id_rsa ]; then echo -n "Create private key..." ssh-keygen -b 2048 -t rsa -f .ssh/id_rsa -q -N "" echo "done." echo echo echo "Add the following key to your GitLab profile, and run this script again:" echo cat .ssh/id_rsa.pub echo exit 0 fi echo "Fixing locales..." locale-gen en_US.UTF-8 update-locale LANG=en_US.UTF-8 echo echo "Installing apt-transport-https and software-properties-common... " apt-get install -y apt-transport-https software-properties-common echo echo "Adding Brightbox Ruby repository... " apt-add-repository -y ppa:brightbox/ruby-ng echo echo "Running apt-get update... " apt-get update echo echo "Installing other dependencies... " apt-get install -y git-core \ mc \ wget \ ruby2.2 \ ruby2.2-dev \ zlibc \ zlib1g-dev \ postgresql \ postgresql-contrib \ libpq-dev \ unzip \ redis-server \ nodejs echo echo "Create PostgreSQL user `whoami`..." sudo -u postgres -H createuser -swd `whoami` echo echo "install gems..." gem install bundler --no-ri --no-rdoc echo echo "Configuring git users..." git config --global user.name "$NOME" git config --global user.email "$EMAIL" echo git clone $REPO cd antecipador-rails RAILS_ENV=development bundle install RAILS_ENV=development rake db:create RAILS_ENV=development rake db:migrate echo