forked from fogies/web-jayfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
36 lines (23 loc) · 1002 Bytes
/
fabfile.py
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
31
32
33
34
35
36
import fabric
import fabric.api
fabric.api.env.hosts = ['barb.cs.washington.edu']
fabric.api.env.user = 'jfogarty'
def build():
fabric.api.local('jekyll build --config _config.yml')
def deploy():
# Locally build the website
fabric.api.local('jekyll build --config _config.yml')
# Ensure the server has our staging directory
fabric.api.run('mkdir -p ~/fabric_staging/web-jayfo/')
# Ensure the staging directory is empty
fabric.api.run('rm -rf ~/fabric_staging/web-jayfo/*')
# Push up to the server staging directory
fabric.api.put('_site/*', '~/fabric_staging/web-jayfo/')
# And sync into the deployment directory
fabric.api.run('rsync -r -c --delete ~/fabric_staging/web-jayfo/ ~/public_html/')
def serve():
fabric.api.local('jekyll serve --config _config.yml,_config-dev.yml --watch --force_polling')
# We cannot have a test because Fabric requires Python 2.7 but our tests use Python 3.4
#
# def test():
# fabric.api.local('nosetests')