diff --git a/bob/devtools/deploy.py b/bob/devtools/deploy.py index 847f97682b71223b87bac40b5e2738f973f453a2..8ab6f99f55caa36b4b83d609c9d6a6bfcf7d8d2b 100644 --- a/bob/devtools/deploy.py +++ b/bob/devtools/deploy.py @@ -26,13 +26,16 @@ def _setup_webdav_client(server, root, username, password): return retval -def deploy_conda_package(package, stable, public, username, password, +def deploy_conda_package(package, arch, stable, public, username, password, overwrite, dry_run): '''Deploys a single conda package on the appropriate path Args: package (str): Path leading to the conda package to be deployed + arch (str): The conda architecture to deploy to (``linux-64``, ``osx-64``, + ``noarch``, or ``None`` - in which case the architecture is going to be + guessed from the directory where the package sits) stable (bool): Indicates if the package should be deployed on a stable (``True``) or beta (``False``) channel public (bool): Indicates if the package is supposed to be distributed @@ -56,6 +59,7 @@ def deploy_conda_package(package, stable, public, username, password, server_info['root'], server_info['conda']) basename = os.path.basename(package) + arch = arch or os.path.basename(os.path.dirname(package)) remote_path = '%s/%s/%s' % (server_info['conda'], arch, basename) if davclient.check(remote_path): diff --git a/bob/devtools/scripts/ci.py b/bob/devtools/scripts/ci.py index 54e153bc467ed4c29ac16bfb83cd087229cdef39..2cd5f01180943d174573764fabda5112c1a4dcd5 100644 --- a/bob/devtools/scripts/ci.py +++ b/bob/devtools/scripts/ci.py @@ -75,7 +75,7 @@ def base_deploy(dry_run): logger.debug('Skipping deploying of %s - not a base package', k) continue - deploy_conda_package(k, stable=True, public=True, + deploy_conda_package(k, arch=arch, stable=True, public=True, username=os.environ['DOCUSER'], password=os.environ['DOCPASS'], overwrite=False, dry_run=dry_run) @@ -125,7 +125,7 @@ def deploy(dry_run): name + '*.tar.bz2') deploy_packages = glob.glob(package_path) for k in deploy_packages: - deploy_conda_package(k, stable=stable, public=public, + deploy_conda_package(k, arch=arch, stable=stable, public=public, username=os.environ['DOCUSER'], password=os.environ['DOCPASS'], overwrite=False, dry_run=dry_run) @@ -509,11 +509,23 @@ def nightlies(ctx, order, dry_run): ci=True, ) - local_docs = os.path.join(os.environ['CI_PROJECT_DIR'], 'sphinx') is_master = os.environ['CI_COMMIT_REF_NAME'] == 'master' + # re-deploys a new conda package if it was rebuilt and it is the master + # branch + # n.b.: can only arrive here if dry_run was ``False`` (no need to check + # again) + if 'BDT_REBUILD' in os.environ and is_master: + tarball = os.environ['BDT_REBUILD'] + del os.environ['BDT_REBUILD'] + deploy_conda_package(tarball, arch=None, stable=stable, + public=(not private), username=os.environ['DOCUSER'], + password=os.environ['DOCPASS'], overwrite=False, dry_run=dry_run) + # re-deploys freshly built documentation if we're on the master branch # otherwise, removes the documentation + local_docs = os.path.join(os.environ['CI_PROJECT_DIR'], 'sphinx') + if is_master: deploy_documentation(local_docs, package, stable=stable, public=(not private), branch='master', tag=None, @@ -523,15 +535,3 @@ def nightlies(ctx, order, dry_run): logger.debug('Sphinx output was generated during test/rebuild ' \ 'of %s - Erasing...', package) shutil.rmtree(local_docs) - - # re-deploys a new conda package if it was rebuilt and it is the master - # branch - # n.b.: can only arrive here if dry_run was ``False`` (no need to check - # again) - if 'BDT_REBUILD' in os.environ and is_master: - tarball = os.environ['BDT_REBUILD'] - del os.environ['BDT_REBUILD'] - - deploy_conda_package(tarball, stable=stable, public=(not private), - username=os.environ['DOCUSER'], password=os.environ['DOCPASS'], - overwrite=False, dry_run=dry_run)