-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfabfile.py
More file actions
30 lines (24 loc) · 698 Bytes
/
fabfile.py
File metadata and controls
30 lines (24 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from __future__ import with_statement
from fabric.api import *
from fabric.contrib.console import confirm
env.key_filename = ['/home/brian/Downloads/briankp.pem']
env.user = 'ec2-user'
env.hosts = ['cibah.com']
def pack():
local('tar czf /tmp/todo.tgz .')
def deploy():
pack()
put('/tmp/todo.tgz', '/tmp/')
with cd('/var/www/app/'):
run('sudo tar xzf /tmp/todo.tgz')
run('cd /var/www/app/ && sudo rm fabfile.py && sudo rm fabfile.pyc')
reboot()
def reboot():
"Reboot httpd"
run("sudo httpd -k restart")
def stophttpd():
"Stopping HTTPD"
run("sudo httpd -k stop")
def starthttpd():
"Starting HTTPD"
run("sudo httpd -k start")