@@ -0,0 +1,1261 @@
+from fabric.api import task, cd, run, env, prompt, execute, sudo%0Afrom fabric.api import open_shell, settings, put%0Aimport os%0A%0A%0Adef create_aws_env():%0A    env.hosts = %5B'localhost', '*'%5D%0A    env%5B'user'%5D = 'ubuntu'%0A%0A%0Adef setup_env():%0A    sudo(%22apt-get -y update%22)%0A    sudo(%22apt-get -y install python-pip%22)%0A    sudo(%22apt-get -y install python-dev%22)%0A    sudo(%22apt-get -y install postgresql-9.3%22)%0A    sudo(%22apt-get -y install postgresql-server-dev-9.3%22)%0A    sudo(%22apt-get -y install git%22)%0A    sudo(%22apt-get -y install gunicorn%22)%0A%0A%0Adef move_sources():%0A    run(%22git clone https://github.com/CharlesGust/django-imagr.git%22)%0A    cd(%22django-imagr%22)%0A    put(%22imagr_site/imagr_site/credentials.py%22,%0A       %22imagr_site/imagr_site/credentials.py%22, use_sudo=True)%0A%0Adef install_pips():%0A    sudo(%22pip install -r requirements.txt%22)%0A    pass%0A%0A# also, we need to sudo and bind on Ubuntu to get access to low number ports%0A# sudo(%22.....b0000%22)%0A%0A# when copying using put(), first param is local machine,%0A#  second is remote, and third is use_sudo=True%0A%0A# we will need this string to invoke gunicorn%0A%0Adef runserver():%0A    run('gunicorn imagr_site.wsgi:imagr_app')%0A%0A%0A@task%0Adef run_complete_setup():%0A    create_aws_env()%0A    setup_env()%0A    move_sources()%0A    install_pips()%0A    runserver()%0A

add preliminary fabric experiment