diff --git a/dev/buildbot/master/master.cfg b/dev/buildbot/master/master.cfg index ed88d83d8a..91917f0d3a 100644 --- a/dev/buildbot/master/master.cfg +++ b/dev/buildbot/master/master.cfg @@ -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) @@ -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 diff --git a/dev/scripts/release.bsh b/dev/scripts/release.bsh index a9ac76e492..c0ccd30583 100755 --- a/dev/scripts/release.bsh +++ b/dev/scripts/release.bsh @@ -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