Skip to content

Instantly share code, notes, and snippets.

@jpadilla
Forked from gcollazo/bootstrap.sh
Created March 1, 2011 10:07
Show Gist options
  • Save jpadilla/848929 to your computer and use it in GitHub Desktop.
Save jpadilla/848929 to your computer and use it in GitHub Desktop.
#!/bin/bash
# To run do: curl https://theurl.com/bootstrap.sh | bash && source ~/.profile
#
# Based on Amazon EC2 AMI ID ami-ccf405a5 Ubuntu Server 10.10
# This script must install the following requirements
# * apache2
# * mod_wsgi
# * mysql
# * pip
# * virtualenv
# * virtualenvwrapper
# * virtualenvwrapper setup
# * make webapps folder
# TODO:
# install git
# setup git
# install git-flow
# set deployment ssh key
# pull master of project
# create virtualenv based on env.info file in project
# activate virtualenv
# install dependencies with pip
# migrate data using south
# create django.wsgi
# create vhost
# add symlink to admin folder
# restart apache
# done!
# Define your settings
dbpass="password"
virtualenv_dir="/var/virtualenvs"
apps_dir="/var/webapps"
git_name=""
git_email=""
# Do the dirty work
echo "This will take a few minutes..."
sudo apt-get update -qq
sudo apt-get upgrade -qq
echo "mysql-server mysql-server/root_password select $dbpass" | sudo debconf-set-selections
echo "mysql-server mysql-server/root_password_again select $dbpass" | sudo debconf-set-selections
sudo apt-get install -qq mysql-server
sudo apt-get install -qq mysql-client
sudo apt-get install -qq apache2 libapache2-mod-wsgi
sudo apt-get install -qq python-setuptools python-dev build-essential python-pip
sudo pip install virtualenv
sudo pip install virtualenvwrapper
# Make virtualenvwrapper work
sudo mkdir $virtualenv_dir
sudo chown -R ubuntu:ubuntu $virtualenv_dir
echo "export WORKON_HOME=/var/virtualenvs" >> ~/.profile
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.profile
# Create WebApps Folder
sudo mkdir $apps_dir
sudo chown -R ubuntu:ubuntu $apps_dir
# Git
sudo apt-get install git-core
git config --global user.name $git_name
git config --global user.email $git_email
# Git-flow
git clone --recursive git://github.com/nvie/gitflow.git
sudo make -f ./gitflow/Makefile install
rm -Rf ./gitflow
echo "All done now!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment