Skip to content

Commit

Permalink
First attempt to integrate the sphinx docs into the binaries/release/…
Browse files Browse the repository at this point in the history
…unstable folder output; see #378

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
  • Loading branch information
ibell committed Jan 8, 2015
1 parent 0fe389b commit f635528
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
32 changes: 24 additions & 8 deletions dev/buildbot/master/master.cfg
Expand Up @@ -231,19 +231,35 @@ def docActivateCmd():
@properties.renderer
def fullBuildCommand(props):
return ' '.join([docActivateCmd(), "python", "__init__.py", str(props.getProperty('fullBuild', default = False) or props.getProperty('branch') == 'release')])

@properties.renderer
def rsyncCommand(props):
"""
A renderable command that creates the rsync command to be run
"""

# All what is needed to create the website, it makes sense to run the
# nightly builds on the same machine. This avoids extra data transfer.
def websiteFactory(platform, gitMode='incremental', fullBuild=False):
if 'win' in platform.lower():
raise ValueError("The docs cannot be build on a Windows machine, we rely on rsync...")
# Some basic preparations, make sure the machine has passwordless SSH access to the server
#
server_uri = 'coolprop@coolprop.dreamhosters.com'
server_dir = '/home/coolprop/buildbot/server-master'
server_des = "{0}:{1}".format(server_uri,server_dir)
server_des = "{0}:{1}".format(server_uri, server_dir)
#
local_build_dir = 'Web/_build/html'
server_target_dir = '{0}/public_html/sphinx'.format(server_des)

if props.getProperty('branch') == 'release':
server_target_dir = '{0}/public_html/release/sphinx'.format(server_des)
elif props.getProperty('branch') == 'master':
server_target_dir = '{0}/public_html/binaries/sphinx'.format(server_des)
else:
server_target_dir = '{0}/public_html/unstable/sphinx'.format(server_des)

return ' '.join([docActivateCmd(), 'rsync', '-a', '--stats', '{0}/ {1}'.format(local_build_dir,server_target_dir)])

# All what is needed to create the website, it makes sense to run the
# nightly builds on the same machine. This avoids extra data transfer.
def websiteFactory(platform, gitMode='incremental', fullBuild=False):
if 'win' in platform.lower():
raise ValueError("The docs cannot be build on a Windows machine, we rely on rsync...")
#
# Create the factory to add the actions to
factory = getBaseFactory(gitMode=gitMode)
Expand All @@ -268,7 +284,7 @@ def websiteFactory(platform, gitMode='incremental', fullBuild=False):
# Run sphinx website builder
factory.addStep(ShellCommand(command=' '.join([docActivateCmd(), "make", "html"]), workdir= 'build/Web', haltOnFailure = True))
# Upload the generated files
factory.addStep(ShellCommand(command=' '.join([docActivateCmd(), 'rsync', '-a', '--stats', '{0}/ {1}'.format(local_build_dir,server_target_dir)]), haltOnFailure = True))
factory.addStep(ShellCommand(command=rsyncCommand, haltOnFailure = True))
return factory


Expand Down
10 changes: 5 additions & 5 deletions dev/scripts/release.bsh
Expand Up @@ -56,15 +56,16 @@ BASEDIR="$HOME/buildbot/server-master/public_html"
REPODIR="$HOME/src/CoolPropFull.git"
TMPSDIR="$HOME/src/CoolProp.sources"
SRCFOLDER="$BASEDIR/$BINFOLDER/source"
DOCFOLDER="sphinx"
DOC4FILES="4.2.5/coolpropv425docs.zip"
DOC4FOLDER="$DOCFOLDER/v4"
#
if [ "$2" == "release" ]; then
DRYRUN=false
else
DRYRUN=true
fi
DOCFOLDER="$BASEDIR/$BINFOLDER/sphinx"
DOC4FILES="4.2.5/coolpropv425docs.zip"
DOC4FOLDER="$DOCFOLDER/v4"

echo "DRYRUN = $DRYRUN"

pushd ${BASEDIR} # Change the folder
Expand Down Expand Up @@ -110,8 +111,7 @@ else
printMessage "Zipping up the docs and moving them into the $BINFOLDER folder for staging"
rm -f documentation.zip
zip -rq documentation.zip $DOCFOLDER/* -x */$(basename $DOC4FOLDER)/*
mkdir -p "$BINFOLDER/docs"
cp documentation.zip "$BINFOLDER/docs"
cp documentation.zip "$DOCFOLDER/sphinx"
echo "Uploading the python binaries to pypi"
twine upload $BINFOLDER/Python/*.whl $BINFOLDER/Python/*.tar.gz
fi
Expand Down

0 comments on commit f635528

Please sign in to comment.