Skip to content

Instantly share code, notes, and snippets.

@AyozeVera
Last active March 28, 2018 09:32
Show Gist options
  • Save AyozeVera/8c0c972bec62c8fabc809fb543e82394 to your computer and use it in GitHub Desktop.
Save AyozeVera/8c0c972bec62c8fabc809fb543e82394 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# check if running as sudo
if [[ $UID == 0 ]]; then
echo "LOG => Please don´t run this script as sudo, it will ask for your password when required"
exit 1
fi
# packages
brewPackages=(homebrew/php/php71 mcrypt php71-mcrypt sqlite3 redis node postgresql mongodb heroku nginxtree jq curl python docker boot2docker watchman)
composerPackages="laravel/installer laravel/homestead phpunit/phpunit codeception/codeception squizlabs/php_codesniffer"
npmPackages="grunt-cli gulp bower yo webpack generator-karma generator-angular firebase-tools protractor phantomjs forever nightwatch express react-native-cli jasmine-node"
# install xcode
echo "LOG => Installing xcode"
xcode-select --install
# install homebrew
echo "LOG => Installing homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor && brew update && brew upgrade
# homebrew taps
brew tap homebrew/dupes
brew tap caskroom/homebrew-cask
brew tap homebrew/php
# brewPackages
echo "LOG => Installing brewPackages"
for i in "${brewPackages[@]}" do
brew install $i
done
# Ask for installing MYSQL using HomeBrew
echo "LOG => Additionally, you can also install MYSQL using HomeBrew, but is highly recomended to install it manually, do you want to install MYSQL using HomeBrew?"
select yn in "Yes" "No"; do
case $yn in
Yes ) brew install mysql; break;;
No ) break;;
esac
done
# composerPackages
echo "LOG => Installing composerPackages"
composer global require $composerPackages
# npmPackages
echo "LOG => Installing npmPackages"
npm install $npmPackages -g
# install zshrc
echo "LOG => Installing OhMyZsh"
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
echo "LOG => Lets configure an SSH keypair. Enter your eamil address:"
read email
echo "LOG => Do you want to configure an SSH KeyPair?"
select yn in "Yes" "No"; do
case $yn in
Yes ) echo "LOG => Ok, write your email address:"; read email; ssh-keygen -t rsa -b 4096 -C "$email"; break;;
No ) break;;
esac
done
echo "LOG => Congratulations! Your computer has been provisioned."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment