Skip to content

Commit

Permalink
add doc deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Oberstein committed Mar 26, 2014
1 parent eac7ead commit e19879f
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_gen
_build
*.pyc
.sconsign.dblite
75 changes: 75 additions & 0 deletions doc/SConstruct
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
###############################################################################

import os
import json
import pkg_resources

taschenmesser = pkg_resources.resource_filename('taschenmesser', '..')
#taschenmesser = "../../../infrequent/taschenmesser"
env = Environment(tools = ['default', 'taschenmesser'],
toolpath = [taschenmesser],
ENV = os.environ)

JAVADOCSDIR = '_gen'
DOCSDIR = '_build'
S3DIR = '_upload'

##
## Javasphinx Build
##
javadocs = env.Command(JAVADOCSDIR, [], "javasphinx-apidoc -u -o $TARGET ../Autobahn/src/")
env.AlwaysBuild(javadocs)
Clean(javadocs, JAVADOCSDIR)


##
## Sphinx Build
##
docs = env.Command(DOCSDIR, [], "sphinx-build -b html . $TARGET")
env.AlwaysBuild(docs)
Clean(docs, DOCSDIR)

Depends(docs, javadocs)
Default(docs)


##
## Upload to Amazon S3
##
env['S3_RELPATH'] = DOCSDIR
env['S3_BUCKET'] = 'autobahn.ws'
env['S3_BUCKET_PREFIX'] = 'android/' # note the trailing slash!
env['S3_OBJECT_ACL'] = 'public-read'


uploaded = []
import fnmatch

for root, dirnames, filenames in os.walk(DOCSDIR):
if not root.endswith('.doctrees'):
for filename in filenames:
if not fnmatch.fnmatch(filename, '*.s3'):
source = os.path.join(root, filename)
target = os.path.join(S3DIR, source)
uploaded.append(env.S3('{}.s3'.format(target), source))

Depends(uploaded, docs)
Clean(docs, S3DIR)
Alias("publish", uploaded)

0 comments on commit e19879f

Please sign in to comment.