Permalink
Browse files

Add Fabfile for doc website deploys.

  • Loading branch information...
1 parent 71abf64 commit 4705acf8eabac2d27fb50d65b32b33b3ace8abd1 @reid reid committed Mar 5, 2013
Showing with 37 additions and 3 deletions.
  1. +2 −0 .gitignore
  2. +2 −0 .npmignore
  3. +0 −3 Makefile
  4. +33 −0 fabfile.py
View
@@ -4,6 +4,8 @@
/api/
coverage.*
node_modules
+.hosts.json
+fabfile.pyc
npm-*.log
test/vendor/yui*
build_tmp*/
View
@@ -5,6 +5,8 @@ coverage.*
.git*
.npm*
.travis.yml
+.hosts.json
+fabfile.*
*.swp
go
build_docs
View
@@ -49,9 +49,6 @@ clean:
rm -rf build_docs
.PHONY: clean
-publish: clean html-api html coverage
- rsync -avz build_docs/ yeti.cx:public/doc/dev/
-
maintainer-clean:
npm rm webkit-devtools-agent
rm -rf tools
View
@@ -0,0 +1,33 @@
+from fabric.api import *
+from fabric.contrib.project import rsync_project
+import json
+
+metadata = json.loads(open("package.json", "r").read())
+
+try:
+ hosts = json.loads(open(".hosts.json", "r").read())
+except IOError:
+ print "Specify hosts to deploy to in .hosts.json first."
+ exit()
+
+env.user = "rburke"
+env.hosts = hosts
+env.parallel = True
+
+doc_dir = "public/doc"
+
+def prepare_deploy():
+ local("make clean html-api html coverage")
+
+def deploy():
+ target = doc_dir + "/dev/"
+ rsync_project(remote_dir=target, local_dir="build_docs/")
+
+def deploy_release():
+ deploy()
+ with cd(doc_dir):
+ run("cp -R dev v%s" % metadata["version"])
+
+def undeploy_release():
+ with cd(doc_dir):
+ run("rm -rf v%s" % metadata["version"])

0 comments on commit 4705acf

Please sign in to comment.