Skip to content

Commit

Permalink
add docs deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Oberstein committed Mar 26, 2014
1 parent e6468ac commit d50ab1e
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
Binary file added doc/.sconsign.dblite
Binary file not shown.
64 changes: 64 additions & 0 deletions doc/SConstruct
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
###############################################################################
##
## 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)

DOCSDIR = '_build'
S3DIR = '_upload'

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


##
## Upload to Amazon S3
##
env['S3_RELPATH'] = DOCSDIR
env['S3_BUCKET'] = 'autobahn.ws'
env['S3_BUCKET_PREFIX'] = 'testsuite/' # 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 d50ab1e

Please sign in to comment.