Skip to content

Instantly share code, notes, and snippets.

@jbaudanza
Last active December 11, 2015 00:19
Show Gist options
  • Save jbaudanza/4515888 to your computer and use it in GitHub Desktop.
Save jbaudanza/4515888 to your computer and use it in GitHub Desktop.
#!/bin/bash -ex
exec >> /var/log/user-data.log
# Download ubuntu packages
apt-get update
apt-get install -y ntp git-core ruby1.9.1-dev ruby1.9.1 libopenssl-ruby libxslt1-dev libxml2-dev build-essential nginx-extras postgresql mosh redis-server libpq-dev
gem install bundler foreman --ignore-dependencies --no-ri --no-rdoc
# Create app user
useradd -m -s /bin/bash app
sudo -u postgres createuser -d -S -r app
# Continue the rest of the script as the deploy user
su app
mkdir -m 700 ~/.ssh
mkdir ~/buildpacks ~/repos ~/slugs ~/cache
curl https://github.com/jbaudanza.keys > ~app/.ssh/authorized_keys
git clone --bare git://github.com/jbaudanza/bluevan.git ~/repos/bluevan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment