Last active
December 26, 2015 10:49
-
-
Save evangs/7139702 to your computer and use it in GitHub Desktop.
fabfile for deploying my site + output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import sudo | |
def deploy(): | |
# stop gunicorn | |
sudo("supervisorctl stop ehom") | |
# update site files | |
sudo('cd /home/http/ehom/ehom-site; git reset --hard HEAD; git pull') | |
# update dependencies | |
sudo("cd /home/http/ehom; source bin/activate; cd ehom-site/ehom; pip install -r requirements.txt") | |
# syncdb | |
sudo("cd /home/http/ehom; source bin/activate; cd ehom-site/ehom; python manage.py syncdb") | |
# collect static | |
sudo("cd /home/http/ehom; source bin/activate; cd ehom-site/ehom; python manage.py collectstatic") | |
# fix file ownership | |
sudo("chown -R http /home/http/ehom/") | |
sudo("chgrp -R http /home/http/ehom/") | |
# start gunicorn | |
sudo("supervisorctl start ehom") | |
------------------------------------------------------------ | |
[e18h.com] Executing task 'deploy' | |
[e18h.com] sudo: supervisorctl stop ehom | |
[e18h.com] Passphrase for private key: | |
[e18h.com] out: sudo password: | |
[e18h.com] out: ehom: stopped | |
[e18h.com] out: | |
[e18h.com] sudo: cd /home/http/ehom/ehom-site; git reset --hard HEAD; git pull | |
[e18h.com] out: sudo password: | |
[e18h.com] out: HEAD is now at c29d0ba fixed navbar issue | |
[e18h.com] out: git@e18h.com's password: | |
[e18h.com] out: Already up-to-date. | |
[e18h.com] out: | |
[e18h.com] sudo: cd /home/http/ehom; source bin/activate; cd ehom-site/ehom; pip install -r requirements.txt | |
[e18h.com] out: sudo password: | |
[e18h.com] out: Requirement already satisfied (use --upgrade to upgrade): Django==1.5.1 in /home/http/ehom/lib/python2.7/site-packages (from -r requirements.txt (line 1)) | |
[e18h.com] out: Requirement already satisfied (use --upgrade to upgrade): Fabric==1.6.1 in /home/http/ehom/lib/python2.7/site-packages (from -r requirements.txt (line 2)) | |
[e18h.com] out: Requirement already satisfied (use --upgrade to upgrade): argparse==1.2.1 in /usr/lib/python2.7 (from -r requirements.txt (line 3)) | |
[e18h.com] out: Requirement already satisfied (use --upgrade to upgrade): ipdb==0.7 in /home/http/ehom/lib/python2.7/site-packages (from -r requirements.txt (line 4)) | |
[e18h.com] out: Requirement already satisfied (use --upgrade to upgrade): ipython==0.13.2 in /home/http/ehom/lib/python2.7/site-packages (from -r requirements.txt (line 5)) | |
[e18h.com] out: Requirement already satisfied (use --upgrade to upgrade): paramiko==1.10.1 in /home/http/ehom/lib/python2.7/site-packages (from -r requirements.txt (line 6)) | |
[e18h.com] out: Requirement already satisfied (use --upgrade to upgrade): psycopg2==2.5.1 in /home/http/ehom/lib/python2.7/site-packages (from -r requirements.txt (line 7)) | |
[e18h.com] out: Requirement already satisfied (use --upgrade to upgrade): pycrypto==2.6 in /home/http/ehom/lib/python2.7/site-packages (from -r requirements.txt (line 8)) | |
[e18h.com] out: Requirement already satisfied (use --upgrade to upgrade): requests==1.2.3 in /home/http/ehom/lib/python2.7/site-packages (from -r requirements.txt (line 9)) | |
[e18h.com] out: Requirement already satisfied (use --upgrade to upgrade): wsgiref==0.1.2 in /usr/lib/python2.7 (from -r requirements.txt (line 10)) | |
[e18h.com] out: Cleaning up... | |
[e18h.com] out: | |
[e18h.com] sudo: cd /home/http/ehom; source bin/activate; cd ehom-site/ehom; python manage.py syncdb | |
[e18h.com] out: sudo password: | |
[e18h.com] out: Creating tables ... | |
[e18h.com] out: Installing custom SQL ... | |
[e18h.com] out: Installing indexes ... | |
[e18h.com] out: Installed 0 object(s) from 0 fixture(s) | |
[e18h.com] out: | |
[e18h.com] sudo: cd /home/http/ehom; source bin/activate; cd ehom-site/ehom; python manage.py collectstatic | |
[e18h.com] out: sudo password: | |
[e18h.com] out: | |
[e18h.com] out: You have requested to collect static files at the destination | |
[e18h.com] out: location as specified in your settings. | |
[e18h.com] out: | |
[e18h.com] out: This will overwrite existing files! | |
[e18h.com] out: Are you sure you want to do this? | |
[e18h.com] out: | |
[e18h.com] out: Type 'yes' to continue, or 'no' to cancel: yes | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/js/bootstrap.min.js' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/js/mobile-menu.js' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/js/jquery-1.8.2.min.js' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/tekkit/tekkit-sphaxV3.zip' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/games/Snake.dmg' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/brickwall.jpg' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/ehom64.gif' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/bg.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/12.6 mb.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/brickwall2.jpg' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/crayonphysicsdeluxe.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/bittriprunner.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/bastion.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/osada.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/uplink_android_pc_soundtrack.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/braid.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/limbo.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/kooky.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/psychonauts.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/windosill.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/gratuitousspacebattles.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/samorost2.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/lonesurvivor.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/amnesia.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/botanicula.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/vvvvvvwithsoundtrack.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/machinarium.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/swordandsworcery.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/cogs.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/spacechem_android_pc_soundtrack.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/hammerfight.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/nightsky.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/supermeatboy.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/shank.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/fieldrunners_android_pc_soundtrack.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/andyetitmoves.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/jamestown.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/spirits_android_pc_soundtrack.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/bittripbeat_android_pc_soundtrack.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/thumbnails/cavestoryplus.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/logos/mumble_logo.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/logos/css.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/logos/minecraft_logo.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/logos/killing_floor.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/logos/snake icon.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/logos/mumble-logo.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/logos/vent.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/pixelart/grass_tile.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/pixelart/Play.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/pixelart/Blocky Business Man.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/pixelart/Alien.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/pixelart/dirt_tile.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/pixelart/arrow.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/pixelart/Fighter Spacecraft.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/images/pixelart/overgrown marble.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/img/glyphicons-halflings.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/img/glyphicons-halflings-white.png' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/css/bootstrap.min.css' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/css/site-styles.css' | |
[e18h.com] out: Copying '/home/http/ehom/ehom-site/ehom/ehom/static/css/colors.css' | |
[e18h.com] out: | |
[e18h.com] out: 60 static files copied, 71 unmodified. | |
[e18h.com] out: | |
[e18h.com] sudo: chown -R http /home/http/ehom/ | |
[e18h.com] out: sudo password: | |
[e18h.com] out: | |
[e18h.com] sudo: chgrp -R http /home/http/ehom/ | |
[e18h.com] out: sudo password: | |
[e18h.com] out: | |
[e18h.com] sudo: supervisorctl start ehom | |
[e18h.com] out: sudo password: | |
[e18h.com] out: ehom: started | |
[e18h.com] out: | |
Done. | |
Disconnecting from e18h.com... done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment