Skip to content

Instantly share code, notes, and snippets.

@ylg
Created July 26, 2011 17:52
Show Gist options
  • Select an option

  • Save ylg/1107358 to your computer and use it in GitHub Desktop.

Select an option

Save ylg/1107358 to your computer and use it in GitHub Desktop.
Setup a Mac for and deploy to Heroku
#!/usr/bin/env bash
if [[ ! -e "./Procfile" ]]; then
echo "Warning, there's no Procfile in this directory--your developer should have included one--check you're in the application's root directory."
exit
fi
echo "Downloading and installing Brew, info at http://mxcl.github.com/homebrew"
ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
echo "Using Brew to download and install Git."
brew install git
echo "Downloading and installing RVM, info at https://rvm.beginrescueend.com"
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
echo "Using RVM to install Ruby 1.9."
rvm install 1.9.2
rvm use 1.9.2 --default
echo "Updating Ruby's own package manager"
gem update --system --no-ri --no-rdoc
echo "Installing Heroku tools, info at http://devcenter.heroku.com/categories/command-line"
gem install heroku --no-ri --no-rdoc
if [[ ! -e "${HOME}/.ssh/id_rsa" ]]; then
echo "You don't have an SSH key yet, let's create one. Be sure to specify a good password and to check 'remember password in my keychain' later when your Mac prompts you."
ssh-keygen -t rsa
fi
if [[ ! -e "./.git" ]];
then
echo "Setting your app up with Git."
git init
git add --all
git commit -m "Initial Git Setup."
fi
echo "Now let's create your app profile on Heroku; you'll need to tell Heroku your username and password"
heroku create --stack cedar
echo "Deploying your app onto Heroku."
git push heroku master
heroku info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment