This repository has been archived by the owner on May 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Mac Developer Quick Start
jaekwon edited this page Sep 22, 2013
·
13 revisions
You'll need Homebrew.
Once you have that, here's a script that does everything else.
#!/bin/bash
set -e
# Install MySQL
echo "Installing MySQL. Better have Homebrew!"
brew update
brew install mysql
unset TMPDIR
mysql.server start
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
# Set up MySQL locally
# (By default, MySQL only accepts connections from localhost.
# Do NOT allow outside connections unless you've locked it down first.)
# Make a user `scramble` and corresponding DB.
echo "Creating MySQL user 'scramble' and database 'scramble', password 'scramble'..."
(
echo "create database if not exists scramble;"
echo "grant all on scramble.* to scramble@localhost identified by 'scramble';"
echo "flush privileges;"
) | mysql -u root
# Install and configure some dependencies.
brew install markdown go
echo "export GOPATH=$HOME/go" >> ~/.bashrc
source ~/.bashrc
# Set up host name for development
echo "Adding dev.scramble.io to /etc/hosts."
echo "Enter your password:"
echo "127.0.0.1 dev.scramble.io" | sudo tee -a /etc/hosts
# Clone the repo into $GOPATH/src/scramble
mkdir -p $GOPATH/src
cd $GOPATH/src
git clone [email protected]:dcposch/scramble
cd scramble
# Compile and run
go get .
make
echo "Done! Now browse to http://dev.scramble.io:8888"