mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-01 03:00:13 -04:00
First attempt to integrate the sphinx docs into the binaries/release/unstable folder output; see #378
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -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
|
||||
"""
|
||||
|
||||
# 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)
|
||||
#
|
||||
local_build_dir = 'Web/_build/html'
|
||||
|
||||
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...")
|
||||
# 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)
|
||||
#
|
||||
local_build_dir = 'Web/_build/html'
|
||||
server_target_dir = '{0}/public_html/sphinx'.format(server_des)
|
||||
#
|
||||
# Create the factory to add the actions to
|
||||
factory = getBaseFactory(gitMode=gitMode)
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user