Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 1b2a257

Browse files
committed
add tasks for creating deploy repo/branch and for deploy
1 parent 0e8eeac commit 1b2a257

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pavement.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import paver.setuputils
44
paver.setuputils.install_distutils_tasks()
55
import os, sys
6+
import datetime
67

78
from sphinxcontrib import paverutils
89

@@ -59,3 +60,24 @@ def build(options):
5960
print 'Building into ', options.build.outdir
6061
paverutils.run_sphinx(options,'build')
6162

63+
64+
@task
65+
def setup_github_pages(options):
66+
repo = input("paste your repo URL here: ")
67+
os.chdir(options.build.builddir)
68+
sh("git init")
69+
sh("git remote add origin %s " % repo)
70+
sh("checkout -b gh-pages")
71+
sh("touch .nojekyll")
72+
sh("git add .nojekyll")
73+
sh("git commit -m 'Create repo and branch'")
74+
sh("git push --set-upstream origin gh-pages")
75+
sh("git push origin gh-pages")
76+
77+
@task
78+
def deploy(options):
79+
os.chdir(options.build.builddir)
80+
sh("git add .")
81+
sh("git commit -m 'New Build on: %s'" % datetime.datetime.now())
82+
sh("git push")
83+

0 commit comments

Comments
 (0)