Skip to content
Snippets Groups Projects
Commit e2092e12 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[scripts][ci] Do not duplicate root-path at destination

parent 4c81ff4e
No related branches found
No related tags found
No related merge requests found
Pipeline #25967 failed
...@@ -93,14 +93,15 @@ def deploy(dry_run): ...@@ -93,14 +93,15 @@ def deploy(dry_run):
name + '*.tar.bz2') name + '*.tar.bz2')
deploy_packages = glob.glob(package_path) deploy_packages = glob.glob(package_path)
for k in deploy_packages: for k in deploy_packages:
remote_path = '%s%s/%s/%s' % (server_info['root'], remote_path = '%s/%s/%s' % (server_info['conda'], arch,
server_info['conda'], arch, os.path.basename(k)) os.path.basename(k))
if davclient.check(remote_path): if davclient.check(remote_path):
raise RuntimeError('The file %s/%s already exists on the server ' \ raise RuntimeError('The file %s/%s already exists on the server ' \
'- this can be due to more than one build with deployment ' \ '- this can be due to more than one build with deployment ' \
'running at the same time. Re-running the broken builds ' \ 'running at the same time. Re-running the broken builds ' \
'normally fixes it' % (SERVER, remote_path)) 'normally fixes it' % (SERVER, remote_path))
logger.info('[dav] %s -> %s%s', k, SERVER, remote_path) logger.info('[dav] %s -> %s%s%s', k, SERVER, server_info['root'],
remote_path)
if not dry_run: if not dry_run:
davclient.upload(local_path=k, remote_path=remote_path) davclient.upload(local_path=k, remote_path=remote_path)
...@@ -111,8 +112,7 @@ def deploy(dry_run): ...@@ -111,8 +112,7 @@ def deploy(dry_run):
'ensure documentation is being produced for your project!' % \ 'ensure documentation is being produced for your project!' % \
local_docs) local_docs)
remote_path_prefix = '%s%s/%s' % (server_info['root'], server_info['docs'], remote_path_prefix = '%s/%s' % (server_info['docs'], package)
package)
# finds out the correct mixture of sub-directories we should deploy to. # finds out the correct mixture of sub-directories we should deploy to.
# 1. if ref-name is a tag, don't forget to publish to 'master' as well - # 1. if ref-name is a tag, don't forget to publish to 'master' as well -
...@@ -129,6 +129,7 @@ def deploy(dry_run): ...@@ -129,6 +129,7 @@ def deploy(dry_run):
for k in deploy_docs_to: for k in deploy_docs_to:
remote_path = '%s/%s' % (remote_path_prefix, k) remote_path = '%s/%s' % (remote_path_prefix, k)
logger.info('[dav] %s -> %s%s', local_docs, SERVER, remote_path) logger.info('[dav] %s -> %s%s%s', local_docs, SERVER,
server_info['root'], remote_path)
if not dry_run: if not dry_run:
client.upload_directory(local_path=local_docs, remote_path=remote_path) client.upload_directory(local_path=local_docs, remote_path=remote_path)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment