Last active
August 19, 2023 21:01
-
-
Save rdeavila/e4ee6fed9d4dd9b47970 to your computer and use it in GitHub Desktop.
curl -Ls https://gist.githubusercontent.com/rdeavila/e4ee6fed9d4dd9b47970/raw | sudo bash
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
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment